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

Re: [Page Visibility] Navigate away behavior (was RE: TPAC 2011 Web Performance WG 2011-11-01)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 15 May 2012 11:56:45 -0400
Message-ID: <4FB27CBD.9090505@mit.edu>
To: public-web-perf@w3.org
On 5/15/12 11:30 AM, Sreeram Ramachandran wrote:
> Do we need to clarify in the spec that the event fires between load
> and pageshow

There would be no visibility change event during an initial page load, 
if it happened in a foreground tab, since the page starts out visible 
and there is no visibility change.  If we wanted to fire a visibility 
change event at all during initial pageload, it would need to fire a 
_lot_ earlier than load/pageshow.  Probably somewhere around when layout 
actually starts.

The firing before pageshow I was talking about is for the case when 
pageshow is being fired when a page comes out of the back/forward cache. 
  In that situation there is no load event, so no need to define 
ordering of the visibility change event and the load event.

> (i.e., add a similar hook to
> http://dev.w3.org/html5/spec/single-page.html#the-end) and that it
> only fires if the visibility state has changed from the document's
> initial visibility state?

If the document's visibility state changes from the initial one during 
pageload, this would hit the normal "queue a task to fire a visibility 
change event" codepath, I would think.

-Boris
Received on Tuesday, 15 May 2012 15:57:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 15 May 2012 15:57:19 GMT