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

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 UTC