Re: [DOMCore] ownerDocument of a Document object

On Fri, Jun 3, 2011 at 5:51 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> DOM Level 3 pretty explicitly says that document.ownerDocument === null
>
> http://www.w3.org/TR/DOM-Level-3-Core/core.html#node-ownerDoc
>
> However this was a part of the spec that I never liked, and I'd love
> to change it. Are there browsers that set document.ownerDocument ===
> document?

IE9, Firefox 5.0a2, Chrome 13 dev, and Opera 11.11 all say null.  I
agree that this is obnoxious.  I wound up writing a helper function
for my test suites that's basically function(node) { return
node.nodeType == Node.DOCUMENT_NODE ? node : node.ownerDocument }.
But it's not clear we can change it at this point.

Received on Sunday, 5 June 2011 18:45:09 UTC