Re: [PageVisibility] location of the interface

On Sun, May 1, 2011 at 9:21 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> The NavigatorVisibility interface is defined to be implemented by the
> Navigator object.  I don’t think this is the best place, since the
> Navigator object has traditionally been a location for browser-wide
> information and functionality to be exposed.  For example, see the kinds
> of things HTML5 defines on window.navigator:
>
>  http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#system-state-and-capabilities:-the-navigator-object
>
> I think this would be better either on the Window object or on the
> Document object.

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.

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

/ Jonas

Received on Monday, 2 May 2011 08:31:26 UTC