W3C home > Mailing lists > Public > public-web-perf@w3.org > December 2012

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

From: Jatinder Mann <jmann@microsoft.com>
Date: Thu, 20 Dec 2012 19:38:25 +0000
To: Scott Andrews <andrewss@rbcon.com>, "public-web-perf@w3.org" <public-web-perf@w3.org>
Message-ID: <d7abc228c6204c2891776282028cdd20@BLUPR03MB065.namprd03.prod.outlook.com>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:33 UTC