W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: Node.ownerDocument property: always defined?

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Mon, 16 Jul 2001 10:28:22 -0400
To: <PBWiz@mail.pbwizard.com>
Cc: <www-dom@w3.org>
Message-ID: <OF06012028.51B1893B-ON85256A8B.004EE22D@pok.ibm.com>

>The reason why Document nodes do not apply is that it is created by the
>parser engine, not a document.  A document is not owned by a document.

There isn't a really good reason that a Document isn't its own
ownerDocument; that's just the way it happened to get defined.

DocumentType is normally created before the document,  without knowing
which document it might be going into, and hence starts out with
ownerDocument being null. When you get around to using it as a parameter in
the createDocument method, its ownerDocument will be set and locked in.

All other nodes have their ownerDocument set before Document.create...()

See also http://www.w3.org/DOM/faq.html#ownerdoc

Joe Kesselman  / IBM Research
Received on Monday, 16 July 2001 10:29:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC