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
Родитель 6113a6857c
Коммит 215c4e9e59
2 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -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
}