RE: making page visibility a property of document instead of top level browsing context

On 1/27/14 2:02 PM, Boris Zbarsky wrote:
> This is very much a compatibility issue. For a simple example,
> http://www.w3.org/TR/vibration/#widl-Navigator-vibrate-boolean-unsigned-long-sequence-unsigned-long--pattern

> specifies that the API is a no-op if document.hidden is true.  So right now that API works in a display:none iframe 
> (whether it _should_ is a separate concern), but if the definition of "hidden" is changed it would stop working.  
> Unless the Vibration API spec continues to specifically reference the PVL1 definition, not the PVL2 one or something...

Yes, I think this is exactly why we should discuss visibility of elements due to the styling or scrolling within the viewport in a more specific Element Visibility spec. The requestAnimationFrame spec is another example of a spec that references Page Visibility today because that's the best available definition of visibility. If we develop an Element Visibility spec that accounts for element styling and scrolling, these specs should reference that definition instead of tying to the top level document. This solution would maintain compatibility and improve power efficiency further.

An example of a good change in Page Visibility that won't break compatibility is if we fix the obscured browser window case to correctly return hidden instead of visible.

Received on Monday, 27 January 2014 22:39:55 UTC