Details
Description
DOMDocumentImpl::replaceChild (DOMNode *newChild, DOMNode *oldChild) just
forwards to fParent.replaceChild, but should check for oldChild == fDocElement
and update fDocElement if so.
Maybe like this:
DOMNode* DOMDocumentImpl::replaceChild(DOMNode *newChild, DOMNode *oldChild)
{
if (oldChild == fDocElement &&
newChild->getNodeType() != DOMNode::ELEMENT_NODE)
throw DOMException(DOMException::HIERARCHY_REQUEST_ERR,0);
fParent.replaceChild (newChild, oldChild);
fDocElement=(DOMElement *)newChild;
return oldChild;
};