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

Re: [PageVisibility] location of the interface

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 3 May 2011 11:08:37 +1200
To: Jonas Sicking <jonas@sicking.cc>
Cc: public-web-perf@w3.org
Message-ID: <20110502230837.GF2576@wok.mcc.id.au>
Jonas Sicking:
> I partially agree with you. However it's always iffy to place things
> on the window object as that is the global namespace for scripts, and
> so you have to worry about colliding with global variables.

It’s fine in Firefox, where declaring and assigning to variables doesn’t
interfere with properties from the Window object, but I see that could
be troublesome for other browsers.  (If we could eventually get to the
point where it is safe to extend Window across implementations that’d be

> The downside with Document is that it exists even on documents that
> aren't displayed, such as ones created using XHR or DOMParser.

Yeah, that’s an argument in favour of Window.  It’s simple enough to
define that `visibilityState == PAGE_HIDDEN` for such documents, though.

Cameron McCormack ≝ http://mcc.id.au/
Received on Monday, 2 May 2011 23:09:08 UTC

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