Bug 553896 - Node.isEqualNode(null) shouldn't throw. r=smaug

This commit is contained in:
2010-03-22 17:06:57 +01:00
parent 941e916e88
commit 1cac3d86ca
5 changed files with 80 additions and 6 deletions

View File

@@ -894,10 +894,11 @@ nsNode3Tearoff::AreNodesEqual(nsIContent* aContent1,
NS_IMETHODIMP
nsNode3Tearoff::IsEqualNode(nsIDOMNode* aOther, PRBool* aReturn)
{
NS_ENSURE_ARG_POINTER(aOther);
*aReturn = PR_FALSE;
if (!aOther)
return NS_OK;
// Since we implement nsIContent, aOther must as well.
nsCOMPtr<nsIContent> aOtherContent = do_QueryInterface(aOther);
// Documents and attributes don't implement nsIContent.