[whatwg] Methods defined for one document called after that document is no longer the one being displayed

Ian Hickson ian at hixie.ch
Tue Aug 5 01:43:05 PDT 2008

On Tue, 5 Aug 2008, Aaron Boodman wrote:
> On Tue, Aug 5, 2008 at 1:12 AM, Ian Hickson <ian at hixie.ch> wrote:
> > Right now, if you navigate an iframe to a document, and take a
> > reference to a method defined in that document, and then navigate that
> > iframe to another document, and then call the method, browsers differ in
> > what they do.
> By 'method' do you mean any function object, defined anywhere in that 
> window? For example, does document.getElementById count? Does the foo in 
> var myglobal = {foo:function(){...}}; ? What about getters?

I think I mean any function object, including getters and setters defined 
by the script (i.e. not host objects). But I haven't checked. Possibly any 
code whose global object is that global object.

> >  - In one browser, the method call fails, saying that methods can't be
> >   called while the document that defined them isn't the active document
> >   of the browsing context whose global object is the method's.
> Off the cuff, this behavior seems good to me. I think it would be good
> if this applied to any function or getter.


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list