Bug 17706 - Node.replaceChild(node, child) doesn't check that child is among node's children
Summary: Node.replaceChild(node, child) doesn't check that child is among node's children
Status: RESOLVED INVALID
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-06 05:13 UTC by Alex Vincent
Modified: 2012-07-06 05:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Vincent 2012-07-06 05:13:10 UTC
DOM4 Editor's Draft states:
To replace a child with node within a parent, run these steps: 
...
Remove child from its parent with the suppress observers flag set. 

The problem is child's parent may not be the same parent as the insertion parent.  The word "its" in this last sentence makes that possible.
Comment 1 Alex Vincent 2012-07-06 05:15:52 UTC
Sorry, folks, I was reading a different part of my code.  This is covered by step 1 in the replaceChild algorithm:

If child's parent is not parent, throw a "NotFoundError" exception and terminate these steps.