W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: [DOMCore] ownerDocument of a Document object

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Sun, 5 Jun 2011 14:44:22 -0400
Message-ID: <BANLkTimjm8Lb8iqN0Lks3dWT6EkXzTmMzQ@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: David Flanagan <dflanagan@mozilla.com>, www-dom@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:07 GMT