Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Checking if an nsIDocument is being examined by the user

0 views
Skip to first unread message

Henri Sivonen

unread,
Nov 23, 2009, 8:35:23 AM11/23/09
to
nsContentSink alters its flushing depending on queued user events on the
event loop. I was thinking of implementing a similar idea for the HTML5
parser.

How can I tell if an nsIDocument is being displayed in the frontmost tab
(perhaps in a frame inside the frontmost tab)? Is there a way (nicer
than what nsContentSink does) to detect if the user is actively
interacting with the frontmost tab?

--
Henri Sivonen
hsiv...@iki.fi
http://hsivonen.iki.fi/

Boris Zbarsky

unread,
Nov 23, 2009, 2:25:31 PM11/23/09
to
On 11/23/09 8:35 AM, Henri Sivonen wrote:
> nsContentSink alters its flushing depending on queued user events on the
> event loop. I was thinking of implementing a similar idea for the HTML5
> parser.
>
> How can I tell if an nsIDocument is being displayed in the frontmost tab
> (perhaps in a frame inside the frontmost tab)?

With great pain, in the general case...

> Is there a way (nicer than what nsContentSink does) to detect if the user is actively
> interacting with the frontmost tab?

It seems to me that the right way to do this might be to run the sink
flushing off the refresh driver or something (and adjust refresh driver
in background tabs, etc, so that decision is centralized).

-Boris

0 new messages