[whatwg] readystatechange for SCRIPT

Boris Zbarsky bzbarsky at MIT.EDU
Fri Sep 9 14:57:44 PDT 2011

On 9/9/11 5:46 PM, Ian Hickson wrote:
> On Fri, 9 Sep 2011, Boris Zbarsky wrote:
>> On 9/9/11 3:40 PM, Ian Hickson wrote:
>>> This is what I'm leaning towards at the moment. Are there any
>>> objections to removing the readyState support from<script>  (reverting
>>> r6543) and moving onreadystatechange to HTMLDocument exclusively?
>> 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?

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?

> 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?


More information about the whatwg mailing list