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

This commit is contained in:
vidur%netscape.com 2000-01-27 05:17:11 +00:00
parent 658e423c71
commit 42cdaa322f
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);
}
}