зеркало из https://github.com/mozilla/gecko-dev.git
Bug 641219 - Fix HTMLElement.getElementsByTagName with foreign children; r=sicking
This commit is contained in:
Родитель
2954d42faa
Коммит
9f951e30b0
|
@ -383,20 +383,6 @@ nsGenericHTMLElement::GetNodeName(nsAString& aNodeName)
|
||||||
return NS_OK;
|
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
|
// Implementation for nsIDOMHTMLElement
|
||||||
nsresult
|
nsresult
|
||||||
nsGenericHTMLElement::GetId(nsAString& aId)
|
nsGenericHTMLElement::GetId(nsAString& aId)
|
||||||
|
|
|
@ -109,8 +109,6 @@ public:
|
||||||
NS_METHOD SetAttribute(const nsAString& aName,
|
NS_METHOD SetAttribute(const nsAString& aName,
|
||||||
const nsAString& aValue);
|
const nsAString& aValue);
|
||||||
NS_METHOD GetTagName(nsAString& aTagName);
|
NS_METHOD GetTagName(nsAString& aTagName);
|
||||||
NS_METHOD GetElementsByTagName(const nsAString& aTagname,
|
|
||||||
nsIDOMNodeList** aReturn);
|
|
||||||
|
|
||||||
// nsIDOMHTMLElement methods. Note that these are non-virtual
|
// nsIDOMHTMLElement methods. Note that these are non-virtual
|
||||||
// methods, implementations are expected to forward calls to these
|
// methods, implementations are expected to forward calls to these
|
||||||
|
|
|
@ -259,6 +259,7 @@ _TEST_FILES = \
|
||||||
test_bug630889.html \
|
test_bug630889.html \
|
||||||
test_bug610212.html \
|
test_bug610212.html \
|
||||||
test_bug633058.html \
|
test_bug633058.html \
|
||||||
|
test_bug641219.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
libs:: $(_TEST_FILES)
|
libs:: $(_TEST_FILES)
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=641219
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<title>Test for Bug 641219</title>
|
||||||
|
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||||
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=641219">Mozilla Bug 641219</a>
|
||||||
|
<p id="display"></p>
|
||||||
|
<div id="content" style="display: none">
|
||||||
|
<div id="div">
|
||||||
|
<font></font>
|
||||||
|
<svg><font/></svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<pre id="test">
|
||||||
|
<script type="application/javascript">
|
||||||
|
/** Test for Bug 641219 **/
|
||||||
|
var HTML = "http://www.w3.org/1999/xhtml",
|
||||||
|
SVG = "http://www.w3.org/2000/svg";
|
||||||
|
var wrapper = document.getElementById("div");
|
||||||
|
is(wrapper.getElementsByTagName("FONT").length, 1);
|
||||||
|
is(wrapper.getElementsByTagName("FONT")[0].namespaceURI, HTML);
|
||||||
|
is(wrapper.getElementsByTagName("font").length, 2);
|
||||||
|
is(wrapper.getElementsByTagName("font")[0].namespaceURI, HTML);
|
||||||
|
is(wrapper.getElementsByTagName("font")[1].namespaceURI, SVG);
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
Загрузка…
Ссылка в новой задаче