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...()
returns.

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



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

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