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

On Tue, May 15, 2012 at 8:56 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> 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.

So, to be consistent, I think we should say that visibility change is
NOT fired after pagehide in the case of a true unload, thus
distinguishing it from the case of a document going into the page
cache.

I.e., in a normal load/unload scenario, the document never sees a
visibilitychange event. Correspondingly, visibilitychange is fired
after pagehide and before pageshow only for documents going into and
out of pagecache.

Apart from consistency, I think the first part (normal load/unload
flow not firing the event) makes it simpler for both apps and pages.

Received on Tuesday, 15 May 2012 17:22:28 UTC