mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-17 18:12:04 +01:00
Check that inserted node isn't an ancestor of the new parent
This commit is contained in:
parent
a8540e640a
commit
d45b5bbcb5
1 changed files with 4 additions and 0 deletions
|
@ -531,6 +531,10 @@ class NodeImplWithChildren : public NodeImpl<stringT, string_adaptorT>,
|
|||
if(NodeImplT::getOwnerDocument() && childDoc != NodeImplT::getOwnerDocument())
|
||||
throw DOM::DOMException(DOM::DOMException::WRONG_DOCUMENT_ERR);
|
||||
|
||||
for(DOMNode_implT* n = this; n != 0; n = n->getParentNode())
|
||||
if(n == child)
|
||||
throw DOM::DOMException(DOM::DOMException::HIERARCHY_REQUEST_ERR);
|
||||
|
||||
checkChildType(child);
|
||||
} // checkCanAdd
|
||||
|
||||
|
|
Loading…
Reference in a new issue