RE: [PageVisibility] Add hidden and visibilityState to visibilitychange event

Scott,

Thanks for providing feedback on the spec.

As you mentioned, the event handler can check document.hidden and document.visibilityState attributes to get that information. Providing the same data in multiple places is redundant and adds unnecessary complexity to the spec. Not making this change will not fundamentally change the usefulness of this API.

Thanks,
Jatinder

From: Scott Andrews [mailto:andrewss@rbcon.com]
Sent: Wednesday, December 19, 2012 9:35 AM
To: public-web-perf@w3.org
Subject: [PageVisibility] Add hidden and visibilityState to visibilitychange event

The 'visibilitychange' event[0] is currently defined as a simple event, containing no unique attributes.  Is there a reason why the event does not include the 'hidden' and 'visibilityState' attributes?

The particular use case I'm trying to satisfy involves capturing an audit log (click stream) of events that can be analyzed offline.  The visibilitychange event as currently defined doesn't provide any detail about the new state, just that the state changed.  While I could copy these properties from the document into the event, including them as part of the spec is reasonable.  As precedent, the 'hashchange' event[1] includes the URL as an attribute, while a developer could lookup the location manually.

Apologies if this has been previously discussed, a search of the list archives didn't turn up any hits.

-Scott

[0] http://www.w3.org/TR/2012/CR-page-visibility-20120726/#sec-visibilitychange-event
[1] http://www.w3.org/TR/2012/WD-html5-20121025/history.html#event-hashchange

Received on Thursday, 20 December 2012 19:41:29 UTC