RE: [PageVisibility] What should the visibility api return in display:none iframes?

We define the visibility as that of the top level browsing context; all connected documents, like iframes, must return the same value. As style updates do not impact the visibility of the top level context, style updates should not have any impact on the visibility state.

Jatinder

-----Original Message-----
From: public-web-perf-request@w3.org [mailto:public-web-perf-request@w3.org] On Behalf Of Boris Zbarsky
Sent: Wednesday, September 28, 2011 7:06 PM
To: public-web-perf@w3.org
Subject: [PageVisibility] What should the visibility api return in display:none iframes?

At the moment, the spec says to return the visibility state of the toplevel browsing context containing the iframe, as far as I can tell. 
Why is that desirable?

In particular, given an iframe script can always get the visibility state of the toplevel browsing context simply by doing top.document.visibilityState.  So having document.visibilityState simply mirror that saves about 4 characters of typing.  On the other hand, there may well be good use cases for detecting the visibility state of display:none iframes, right?

-Boris

Received on Wednesday, 5 October 2011 23:04:11 UTC