RE: [Page Visibility] Spec Updates

Based on feedback from the mailing list and action items from the last conference call, I've made the following updates to the Page Visibility spec, http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html:



-          Interface exposed on Document instead of Window

I have updated the Page Visibility properties to be exposed on Document instead of Window to reduce (undeclared) global variable collisions.



-          Feature detection

Using if (document.visible) for feature detection has the downside that the undefined case, which legacy browsers would hit, is equal to the not visible case; meaning legacy browsers will get the behavior defined for the hidden page. An alternative test is to check whether document.visibilityState exists, even if a web developer is only interested in document.visible. Instead, a simpler approach may be to define the boolean as document.hidden. Doing feature detection on document.hidden will ensure that the undefined case is equal to the visible page case; legacy browsers will get the page with the visible behavior. I have updated references to document.visible to document.hidden. Please review this change.



I've also updated the example section to use feature detection with document.hidden.



-          PAGE_PRERENDER and PAGE_PREVIEW are optional

Considering these two states may not always make sense for a user agent, they have been defined as optional. E.g., a mobile user agent may not have the concept of a preview.



-          Removed PAGE_OTHER state

If a user agent wants to provide an experimental implementation, they can do so with a prefixed state. The PAGE_OTHER state doesn't provide any additional benefit. As per agreement on the conference call, I have removed this state.



-          Constants changed to DOMStrings

Based on feedback, I have changed the constants from unsigned shorts to strings.



-          Fully obscured case.

Based on feedback on the mailing list, determining whether the page is visible when the user agent is fully obscured by another application is difficult. Further, most accessibility tools, like magnifier, require to be full screen. Returning PAGE_HIDDEN in this case will always give the hidden page behavior to accessibility tools. I have added such text to clarify that this scenario may be treated as visible:

"To accommodate accessibility tools that are typically full screen but still show a view of the page, when applicable, document.hidden may return false when the User Agent is not minimized but is fully obscured by other applications."
Please review these changes and provide additional feedback.

Thanks,
Jatinder

Received on Friday, 13 May 2011 21:15:17 UTC