Re: [PageVisibility] location of the interface

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
good.)

> 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