W3C home > Mailing lists > Public > public-web-perf@w3.org > September 2011

[PageVisibility] Are visibility change events synchronous?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 28 Sep 2011 22:25:07 -0400
Message-ID: <4E83D703.5030302@mit.edu>
To: public-web-perf@w3.org
If there is a visibility change, is the visibility change event fired 
synchronously?

Note that this is sort of page-observable: a page could poll the 
visibilityState and see whether it matches the previous state without 
having seen an event.  Then again, it's hard to tell that situation 
apart from one where some other script called stopImmediatePropagation 
on the event and then dispatched a new event...

My personal preference would be to allow or require asynchronous firing; 
the alternative involves, e.g. a tab switch triggering synchronous JS 
execution before it completes, which is not great for users navigating 
across tabs using the keyboard.

-Boris
Received on Thursday, 29 September 2011 02:25:45 UTC

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