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:
parent
da773f8ae1
commit
b0d8cb960b
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user