Bug 17706 - Node.replaceChild(node, child) doesn't check that child is among node's children
Node.replaceChild(node, child) doesn't check that child is among node's children
Status: RESOLVED INVALID
Product: WebAppsWG
Classification: Unclassified
Component: DOM
unspecified
All All
: P2 normal
: ---
Assigned To: Anne
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
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.