Fixed bug 16609. RemoveNamedItem now returns the correct error code if the attribute doesn't exist. r=pollmann

git-svn-id: svn://10.0.0.236/trunk@58887 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
vidur%netscape.com 2000-01-27 05:17:11 +00:00
parent da773f8ae1
commit b0d8cb960b
2 changed files with 6 additions and 4 deletions

View File

@ -418,14 +418,15 @@ nsDOMAttributeMap::RemoveNamedItem(const nsString& aName, nsIDOMNode** aReturn)
// Drop the reference held in the hash table
NS_RELEASE(attribute);
// Unset the attribute in the content
result = mContent->UnsetAttribute(nameSpaceID, nameAtom, PR_TRUE);
}
else {
result = NS_ERROR_DOM_NOT_FOUND_ERR;
*aReturn = nsnull;
}
// Unset the attribute in the content
result = mContent->UnsetAttribute(nameSpaceID, nameAtom, PR_TRUE);
NS_IF_RELEASE(nameAtom);
}
}

View File

@ -418,14 +418,15 @@ nsDOMAttributeMap::RemoveNamedItem(const nsString& aName, nsIDOMNode** aReturn)
// Drop the reference held in the hash table
NS_RELEASE(attribute);
// Unset the attribute in the content
result = mContent->UnsetAttribute(nameSpaceID, nameAtom, PR_TRUE);
}
else {
result = NS_ERROR_DOM_NOT_FOUND_ERR;
*aReturn = nsnull;
}
// Unset the attribute in the content
result = mContent->UnsetAttribute(nameSpaceID, nameAtom, PR_TRUE);
NS_IF_RELEASE(nameAtom);
}
}