diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 556e2fb40dd..ea5815d48ca 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -1095,19 +1095,6 @@ nsIContent::IsEqual(nsIContent* aOther) return PR_FALSE; } } - - // Child nodes count. - PRUint32 childCount = GetChildCount(); - if (childCount != element2->GetChildCount()) { - return PR_FALSE; - } - - // Iterate over child nodes. - for (PRUint32 i = 0; i < childCount; ++i) { - if (!GetChildAt(i)->IsEqual(element2->GetChildAt(i))) { - return PR_FALSE; - } - } } else { // Node value check. nsCOMPtr domNode1 = do_QueryInterface(this); @@ -1120,6 +1107,18 @@ nsIContent::IsEqual(nsIContent* aOther) } } + // Child nodes count. + PRUint32 childCount = GetChildCount(); + if (childCount != aOther->GetChildCount()) { + return PR_FALSE; + } + + // Iterate over child nodes. + for (PRUint32 i = 0; i < childCount; ++i) { + if (!GetChildAt(i)->IsEqual(aOther->GetChildAt(i))) { + return PR_FALSE; + } + } return PR_TRUE; } diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index 8a4ec3e1797..6592a31a82f 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -370,17 +370,17 @@ _TEST_FILES2 = \ file_CSP_main.html \ file_CSP_main.html^headers^ \ file_CSP_main.js \ - test_CSP_frameancestors.html \ - file_CSP_frameancestors.sjs \ - file_CSP_frameancestors_main.html \ - file_CSP_frameancestors_main.js \ - test_CSP_inlinescript.html \ - file_CSP_inlinescript_main.html \ - file_CSP_inlinescript_main.html^headers^ \ - test_CSP_evalscript.html \ - file_CSP_evalscript_main.html \ - file_CSP_evalscript_main.html^headers^ \ - file_CSP_evalscript_main.js \ + test_CSP_frameancestors.html \ + file_CSP_frameancestors.sjs \ + file_CSP_frameancestors_main.html \ + file_CSP_frameancestors_main.js \ + test_CSP_inlinescript.html \ + file_CSP_inlinescript_main.html \ + file_CSP_inlinescript_main.html^headers^ \ + test_CSP_evalscript.html \ + file_CSP_evalscript_main.html \ + file_CSP_evalscript_main.html^headers^ \ + file_CSP_evalscript_main.js \ test_bug540854.html \ bug540854.sjs \ test_bug548463.html \ @@ -444,6 +444,7 @@ _TEST_FILES2 = \ test_bug605982.html \ test_bug606729.html \ test_treewalker_nextsibling.xml \ + test_bug614058.html \ $(NULL) # This test fails on the Mac for some reason diff --git a/content/base/test/test_bug614058.html b/content/base/test/test_bug614058.html new file mode 100644 index 00000000000..41a153b3f90 --- /dev/null +++ b/content/base/test/test_bug614058.html @@ -0,0 +1,30 @@ + + + + + Test for Bug 614058 + + + + + +Mozilla Bug 614058 +

+ +
+
+
+ +