[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 Thursday, 29 September 2011 02:06:21 UTC