If node doesn't belong to this element, complain

This commit is contained in:
jez 2010-12-29 15:41:56 +00:00
parent 90156036c0
commit e4fd3c8239

View file

@ -92,8 +92,9 @@ class AttrMap : public NamedNodeMapImpl<stringT, string_adaptorT>
DOMAttr_implT* removeAttributeNode(DOMAttr_implT* oldAttr)
{
if(removeNamedItem(oldAttr->getNodeName()) == 0)
if(oldAttr->getOwnerElement() != ownerElement_)
throw DOM::DOMException(DOM::DOMException::NOT_FOUND_ERR);
removeNamedItem(oldAttr->getNodeName());
return oldAttr;
} // removeAttributeNode