W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2005

[dom3core] WRONG_DOCUMENT_ERR

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 30 Nov 2005 17:10:59 -0800
Message-Id: <93604143-8B48-4021-AFDB-E6EE7D8930C5@apple.com>
Cc: vicki Murley <vicki@apple.com>, andersca@mac.com
To: DOM mailing list <www-dom@w3.org>

The DOM Level 3 Core (and Level 1 and Level 2) spec requires  
WRONG_DOCUMENT_ERR to be raised in many cases where a child is  
inserted into a document other than its owner document, for example,  
here for appendChild:

http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/ 
core.html#ID-184E7107

However, historically browser-based DOM implementations have let you  
reparent elements freely, and there are in fact web sites out there  
that create an element in one document and then insert it into  
another. Safari actually limits the reparenting to the case of  
elements that have never been in a document, to cover such sites.

This is causing Safari to fail 5 tests in the DOM Level 1 Core test  
suite, these are our only failures besides the getAttribute issue  
mentioned by Anne.

I'd like to request an erratum to make raising this exception  
optional. There does not seem to be much benefit to requiring DOM  
implementations to enforce this limit.

Regards,
Maciej
Received on Thursday, 1 December 2005 12:29:06 GMT

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