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

Based on your feedback, I have updated the Page Visibility processing model. 

On 5/17/2012 5:26 PM, Boris wrote:
> 1) When traversing _from_ session history entries browsers fire a _pagehide_ event.  
> But your spec text talks about firing a _pageshow_ event.  There's a similar issue with 
> the events being reversed in teh traversing _to_ session history entries case.

I made a mistake where I thought bfcache = session history. After a little more digging around, from http://dev.w3.org/html5/spec/history.html#session-history-entry: The pageshow event is fired when traversing to a session history entry. The pagehide event is fired when traversing from a session history entry.

And from https://developer.mozilla.org/En/Working_with_BFCache: The pagehide event tells you whether the page is going into bfcache; the pageshow tells you whether it's coming from bfcache.

On 2/3/2012 12:12PM Boris wrote:
> The reason I want to fire visibilitychange before pageshow and after pagehide is that:
> 1)  The latter preserves the invariant that it actually triggers on visibility state changes: it fires after we're actually hidden.
> 2)  The former preserves the general ordering of visibility changes and page show/hide.  

I have updated the spec to fire visibilitychange before pageshow and after pagehide, as you had suggested.

On 5/17/2012 5:26 PM, Boris wrote:
> 2) When unloading a document, why would a UA not end up in the " Else if the Document 
> contained by the top level browsing context is now not visible" branch if the if/else cascade?  
> Seems like it would, as the spec is currently written...

I have fixed this by including the unloading statements as a part of the not visible statements.

On 5/17/2012 5:26 PM, Boris wrote:
> 3) The addition of pageshow/pagehide event firing in this spec would, if actually implemented,
>  make those events fire twice.  That doesn't seem right.

Instead of stating that the UA should fire the event, I now state "If traversing to a session history entry, run the following steps before running the step to fire the pageshow event." Likewise for pagehide.

On 5/17/2012 5:26 PM, Boris wrote:
> 4) The event firing for the "unloading document visibility change steps" 
> should not be restricted to the unloading of top-level documents, imo: 
> if a subframe document is unloaded its visibility should change to hidden.

I have updated the processing model to not restrict the unloading steps to top-level documents. This step now applies to any document that is unloading.

Thanks,
Jatinder

Received on Tuesday, 10 July 2012 23:11:42 UTC