[PageVisibility] Feedback on the spec

"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 
the user could hide the top level browsing context while still having 
the child browsing context visible.

"The User Agent is minimized and a preview is shown."

The term preview is used throughout the spec without really defining 
what it means.

"On getting, visibilityState attribute MUST return one of the following 
DOMStrings or a vendor prefixed DOMString as defined in 4.5 Vendor Prefixes"

I don't think there is any need for vendor prefixed extensions here. In 
particular such prefixed features have not been a successful model for 
extending the platform, with the prefixes themselves becoming part of 
the defacto-required API. If we need to extend the API in the future 
with new use cases we should do so in the spec rather than give people 
free reign to

In addition, the spec is contradictory. Section 4.2 defines in vague 
terms (but with normative language) what should be returned in various 
situations. Then section 4.4 defines a processing model that explicitly 
controls the value of the various attributes after specific actions. All 
the text from section 4.2 that is a direct consequence of 4.4 should be 
made non-normative. The same applies to section 4.3.

"If the Document contained by the top level browsing context is now visible"

"Is now visible" is formatted to look like a definition. But this is not 
a definition. It should probably be a link to a definition of the term 
"visible" elsewhere in the document. In general please use formatting in 
a way that is consistent with other specs.

"Else if the Document contained by the top level browsing context is now 
no longer visible"

Same comment.

"Else if the user agent is to unload the Document contained by the top 
level browsing context, follow these steps, "

Please use the hooks provided in HTML5 for this purpose.

"4.5 Vendor Prefixes"

Please kill this section.

"6 References"

Please ensure that all urls are hyperlinks.

In general I wonder if it wouldn't be better to fire visibilitychange 
events at all documents in the unit of related browsing context. 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.

Received on Tuesday, 3 April 2012 14:58:03 UTC