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

Re: [DOMCore] ownerDocument of a Document object

From: David Flanagan <dflanagan@mozilla.com>
Date: Fri, 03 Jun 2011 14:44:30 -0700
Message-ID: <4DE955BE.9050809@mozilla.com>
To: www-dom@w3.org
Also, the final step of the ensure algorithm is this:
> If old's |ownerDocument 
> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-node-ownerdocument>| 
> and new's |ownerDocument 
> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-node-ownerdocument>| 
> are not the same, throw a |HIERARCHY_REQUEST_ERR 
> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-domexception-hierarchy_request_err>|
It seems to me that the previous steps of the algorithm ensure that they 
are the same and that this step is not necessary.

On 6/3/11 2:34 PM, David Flanagan wrote:
> Both Firefox and Chrome make the ownerDocument of a Document node null.
>
> The June 3rd spec just says:
>> The |ownerDocument| attribute must return the |Document 
>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document>| 
>> node that the context object 
>> <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#context-object> 
>> is associated with, or null if there is none. 
> The meaning of this depends on whether a node is "associated with" itself.
>
> But the (new, I think) algorithm to ensure that two node are in the 
> same document requires document.ownerDocument === document, or it will 
> fail in the case of inserting a doctype into a document.
>
>     David
>
Received on Friday, 3 June 2011 21:44:59 GMT

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