From 9f951e30b01a9439111b6d5dbc7c283691910909 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 29 Mar 2011 22:24:53 -0400 Subject: [PATCH] Bug 641219 - Fix HTMLElement.getElementsByTagName with foreign children; r=sicking --- .../html/content/src/nsGenericHTMLElement.cpp | 14 -------- .../html/content/src/nsGenericHTMLElement.h | 2 -- content/html/content/test/Makefile.in | 1 + content/html/content/test/test_bug641219.html | 35 +++++++++++++++++++ 4 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 content/html/content/test/test_bug641219.html diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 6abb3a74bf99..76cc47909d53 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -383,20 +383,6 @@ nsGenericHTMLElement::GetNodeName(nsAString& aNodeName) return NS_OK; } -nsresult -nsGenericHTMLElement::GetElementsByTagName(const nsAString& aTagname, - nsIDOMNodeList** aReturn) -{ - // Only lowercase the name if this is an HTML document. - if (IsInHTMLDocument()) { - nsAutoString lower; - nsContentUtils::ASCIIToLower(aTagname, lower); - return nsGenericHTMLElementBase::GetElementsByTagName(lower, aReturn); - } - - return nsGenericHTMLElementBase::GetElementsByTagName(aTagname, aReturn); -} - // Implementation for nsIDOMHTMLElement nsresult nsGenericHTMLElement::GetId(nsAString& aId) diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 39751d996a49..4ee3ec6c1ebf 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -109,8 +109,6 @@ public: NS_METHOD SetAttribute(const nsAString& aName, const nsAString& aValue); NS_METHOD GetTagName(nsAString& aTagName); - NS_METHOD GetElementsByTagName(const nsAString& aTagname, - nsIDOMNodeList** aReturn); // nsIDOMHTMLElement methods. Note that these are non-virtual // methods, implementations are expected to forward calls to these diff --git a/content/html/content/test/Makefile.in b/content/html/content/test/Makefile.in index d9f5843b298f..8e9f031aca66 100644 --- a/content/html/content/test/Makefile.in +++ b/content/html/content/test/Makefile.in @@ -259,6 +259,7 @@ _TEST_FILES = \ test_bug630889.html \ test_bug610212.html \ test_bug633058.html \ + test_bug641219.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/html/content/test/test_bug641219.html b/content/html/content/test/test_bug641219.html new file mode 100644 index 000000000000..c04654cbfcf0 --- /dev/null +++ b/content/html/content/test/test_bug641219.html @@ -0,0 +1,35 @@ + + + + + Test for Bug 641219 + + + + + +Mozilla Bug 641219 +

+ +
+
+
+ +