[whatwg] readystatechange for SCRIPT

Ian Hickson ian at hixie.ch
Fri Sep 9 18:10:08 PDT 2011

On Fri, 9 Sep 2011, Boris Zbarsky wrote:
> > > 
> > > HTMLDocument, or Document?
> > 
> > They're more or less the same, per spec.
> Well.... no, they're not.  In particular, HTMLDocument.prototype is not 
> on the prototype chain of XMLDocument.prototype in any UA I'm aware of, 
> whereas Document.prototype is.  Perhaps you're saying the spec will 
> change that?

Right, hence "per spec". :-)

The idea is to move to a world with only one Document interface, which 
contains everything from SVGDocument, HTMLDocument, Document, etc, because 
it really makes no sense that SVG fragments in HTML documents can't use 
the Document-level SVG APIs, and vice-versa.

Exactly how this is to happen is not yet clear.

> Now any given document object may implement both interfaces, but where 
> properties live in the prototype chain is _very_ different depending on 
> whether they're on Document or HTMLDocument.  Again, assuming that there 
> is a separate HTMLDocument interface object and so forth.


> > > If it's put on HTMLDocument exclusively, that would solve the 
> > > XMLDocument.prototype problem as well.  But the readyState property 
> > > seems to be on Document, not HTMLDocument....
> > 
> > HTMLDocument in the HTML spec defines HTMLDocument.readyState but 
> > says:
> > 
> >     Document implements HTMLDocument;
> Doing that means that hooking HTMLDocument.prototype methods won't 
> actually change methods on documents, right?  How web-compatible is 
> that?

I don't believe it's compatible at all. The spec is likely to change on 
this matter.

> > There's been a suggestion that I should just define it as a partial 
> > interface for Document instead and then define HTMLDocument === 
> > Document, but I haven't looked into that yet.
> That might actually be more web-compatible....  Maybe.


> > Since nobody seems to object, I'm going to revert r6543 and make 
> > onreadystatechange special.
> Sounds good.  Please let me know when the new spec text is up?

It is done.


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