Re: [PageVisibility] Feedback on the spec

On 4/3/12 10:57 AM, James Graham wrote:
> "On getting, the hidden attribute MUST return true if the Document
> contained by the top level browsing context (root window in the
> browser's viewport) is not visible at all. The attribute MUST return
> false if the Document contained by the top level browsing context is at
> least partially visible on at least one screen."
>
> Is the reference to top level browsing context here really what's
> wanted? For example if one document opens a page using window.open

Then at that point there are two top level browsing contexts.

"top level" just goes up the .parent chain; it doesn't go across .opener.

> In general I wonder if it wouldn't be better to fire visibilitychange
> events at all documents in the unit of related browsing context.

I'm not sure what you mean...

> This would make it easier for authors to get up-to-date visibility
> information rather than relying on them hooking into the
> visibilitychange event for the top level browsing context.

visibilitychange events are fired on all documents whose visibility 
changes.  So if you have a browser window containing a page and that 
page has a subframe and the user minimizes the window, you should get 
one visibilitychange event in the page and one in the subframe.

-Boris

Received on Tuesday, 3 April 2012 15:28:20 UTC