Bug 771934 - Throw NOT_FOUND_ERR instead of HIERARCHY_REQUEST_ERR from nsINode::RemoveChild; r=bz

This commit is contained in:
Ms2ger 2012-08-04 09:43:59 +02:00
parent 6113a6857c
commit 215c4e9e59
2 changed files with 3 additions and 4 deletions

View File

@ -437,10 +437,11 @@ nsINode::RemoveChild(nsINode *aOldChild)
}
if (IsNodeOfType(eDATA_NODE)) {
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
// aOldChild can't be one of our children.
return NS_ERROR_DOM_NOT_FOUND_ERR;
}
if (aOldChild && aOldChild->GetNodeParent() == this) {
if (aOldChild->GetNodeParent() == this) {
nsContentUtils::MaybeFireNodeRemoved(aOldChild, this, OwnerDoc());
}

View File

@ -1,5 +1,3 @@
{
"Calling removeChild on a comment with no children should throw NOT_FOUND_ERR.": true,
"Calling removeChild on a text with no children should throw NOT_FOUND_ERR.": true,
"Passing a value that is not a Node reference to removeChild should throw TypeError.": true
}