Bug 4569 - DOM tests expect "wrong document" exception
Summary: DOM tests expect "wrong document" exception
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 4565
  Show dependency treegraph
 
Reported: 2005-08-21 17:29 PDT by Darin Adler
Modified: 2022-08-05 15:23 PDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-08-21 17:29:56 PDT
The following W3C DOM Level 1 Core tests are failing:

    hc_attrappendchild5
    hc_attrinsertbefore6
    hc_nodeappendchildnewchilddiffdocument
    hc_nodeinsertbeforenewchilddiffdocument
    hc_nodereplacechildnewchilddiffdocument

In all these cases, I believe the reason for the failure is that we don't give the "wrong document" 
exception when moving nodes between documents.

As I read the standard, it's up to the implementation whether or not it gives this exception. We chose to 
support moving the nodes between documents, so I think the tests may be wrong.
Comment 1 Darin Adler 2005-08-26 19:55:21 PDT
Curt, what do you think? Is this an error in the tests?
Comment 2 Curt Arnold 2005-08-26 21:00:54 PDT
The phrasing in http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
core.html#ID-184E7107 for WRONG_DOCUMENT_ERR is consistent with a required exception.  Contrast 
that with NOT_SUPPORTED_ERR which contains a phrase "might be raised".

This may be another one to raise to the IG.  The test as written is consistent with the Java 
implementations, the original NIST tests and my reading of the recommendation.  However, I do not 
believe any browser raises the WRONG_DOCUMENT_ERR, though I'm not sure what they do in that 
situation.  There may be a case for an errata to change the phrasing to "May be raised" based existing 
implementations with corresponding changes to the tests.
Comment 3 Maciej Stachowiak 2005-12-03 01:33:06 PST
The DOM working group does not seem amenable to issuing an erratum for this (although it has been 
discovered that the spec wording may already make the exception optional).
Comment 4 Ian 'Hixie' Hickson 2008-01-06 17:23:23 PST
We should totally change the spec on this, at least for the Web DOM Core version. This is a pointless restriction that in practice doesn't affect any browsers as far as I can tell.
Comment 5 Alexey Proskuryakov 2009-02-16 02:48:27 PST
See also: bug 12339.
Comment 6 Lucas Forschler 2019-02-06 09:03:26 PST
Mass moving XML DOM bugs to the "DOM" Component.
Comment 7 Ahmad Saleem 2022-08-05 15:22:47 PDT
*** Safari 15.6 on macOS 12.5 ***

> hc_attrappendchild5

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_attrinsertbefore6

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodeappendchildnewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodeinsertbeforenewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodereplacechildnewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

*** Firefox Nightly 105 ***

> hc_attrappendchild5

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_attrinsertbefore6

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodeappendchildnewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodeinsertbeforenewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodereplacechildnewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

*** Chrome Nightly 106 ***

> hc_attrappendchild5

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_attrinsertbefore6

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodeappendchildnewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodeinsertbeforenewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

> hc_nodereplacechildnewchilddiffdocument

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument
Status: failure
Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed

____________

Link - https://www.w3.org/2007/03/dom-tests/

Since all browsers are matching each other as of today on these test cases (I know they might not be valid but I just wanted to test to ensure that the behavior is consistent). I am going to mark this as "RESOLVED CONFIGURATION CHANGED". Thanks!

If I am incorrect, please tag this accordingly. Thanks!