- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Wed, 05 Oct 2011 23:38:11 -0400
- To: Jatinder Mann <jmann@microsoft.com>
- CC: "public-web-perf@w3.org" <public-web-perf@w3.org>
On 10/5/11 7:10 PM, Jatinder Mann wrote:
> I don't know if there is value in changing the visibility state properties when the page is unloaded - developers should key off of the unload event to save state and do cleanup work instead. From the UA point of view, to support this behavior might be a lot of work with limited usefulness to the developer. Do you have a scenario in mind where this could be useful?
Well, as I see it we have the following options:
1) Have .visibilityState/.hidden continue to return "visible" for
documents that used to be visible and then were unloaded. Note
that this is pretty easy to observe, since script can have
references to unloaded documents.
2) Have the visibility/hidden state change during unload or load from
document cache without actually firing an event.
3) Do what I implemented in Gecko for now, and actually update the
state and fire the event when pageshow/pagehide fire.
#3 seems like the most self-consistent behavior to me. Which one of the
other two are you proposing we specify if you don't like #3? Or do you
have a fourth option in mind?
Note, by the way, that documents going into the document cache as well
as those that are unloaded, end up with a null defaultView in at least
some UAs, so current spec with agreed-on modifications says that #1 is
not OK for those UAs.
-Boris
Received on Thursday, 6 October 2011 03:38:39 UTC