[whatwg] document.readyState and its initial value

Ian Hickson ian at hixie.ch
Tue Aug 5 14:02:47 PDT 2008


On Tue, 5 Aug 2008, Jonas Sicking wrote:
> Ian Hickson wrote:
> > > But, oddity is par for the course in DOM, so I guess we'll just follow the
> > > HTML 5 spec as-is, initialize readyState to "loading" in the object
> > > constructor, and keep our fingers crossed.
> > 
> > If you find any problems with doing this, please let me know, so we can
> > update the spec!
> 
> The concern I have with doing that is that document created through 
> other means, such as .implementation.createDocument, 
> XSLTProccessor.transformToDocument, DOMParser.parse, etc, probably 
> should not be in the 'uninitialized' state. Especially the last two 
> should return documents that is in the 'complete' state I would think.

IE doesn't have any of those mechanisms. In IE,

   w(new ActiveXObject("Msxml.DOMDocument").readyState);

...returns "4", which isn't any of the values I expected.

Right now the spec says that anything that doesn't go through a parser 
will remain in the readyState == "loading" state forever. Is that a 
problem? We could define that mechanisms that create a Document object 
without an associated parser set it to "complete" if you want. I'm not 
sure that that would be especially useful, although it would, I guess, be 
somewhat more self-consistent.

Does anyone have an opinion on this?

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