Closed Bug 16606 Opened 25 years ago Closed 24 years ago

replaceChild(newnode,document) throws wrong exception

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: dbaron, Assigned: vidur)

Details

(Whiteboard: [HAVE FIX])

DESCRIPTION:  Calling Node.replaceChild(newnode,document) should throw a
NOT_FOUND_ERR rather than a HIERARCHY_REQUEST_ERR because the document is not an
already existing child of Node.  A HIERARCHY_REQUEST_ERR would be appropriate if
document were the first argument and were being inserted.

STEPS TO REPRODUCE:
 * Load http://www.fas.harvard.edu/~dbaron/dom/test/one-core-xml/exceptions
   or http://www.fas.harvard.edu/~dbaron/dom/test/one-core-html/exceptions
 * hit test

ACTUAL RESULTS:
 * the line below the line "Trying helem.replaceChild(pelem,document) :" is
   red.  This line is right before the bold heading starting the tests for
   removeChild().  It currently shows that a HIERARCHY_REQUEST_ERR is being
   thrown.

EXPECTED RESULTS:
 * the line should be green

DOES NOT WORK CORRECTLY ON:
 * Linux, viewer, 1999-10-15-11-M11
calling removeChild(document) has the exact same problem.  It should throw
NOT_FOUND_ERR, I think, rather than HIERARCHY_REQUEST_ERR.  removeChild() is
definitely not permitted to throw a HIERARCHY_REQUEST_ERR - it's not among the
listed codes.

The relevant test is the one right below the previous one described - the first
test under the removeChild() section.
In an attempt to get my bug list in order again, marking all the bugs I have
currently as ASSIGNED.
Johnny Stenback has a fix for this waiting in his tree.
Whiteboard: [HAVE FIX]
Target Milestone: M15
The fix is checked in now, marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Mass update of qa contact
QA Contact: gerardok → janc
Component: DOM Level 1 → DOM HTML
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
verified
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.