Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace-xhtml.xhtml - WPT Dashboard Interop Dashboard
<head>
<title>getElementsByName and foreign namespaces</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<div id="test">
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
</math></p>
<rect width="300" height="100" fill="rgb(0,0,255)"/>
</svg></p>
</div>
<script>
test(function() {
var ps = document.getElementById("test")
.getElementsByTagName("p");
assert_equals(document.getElementsByName("math").length, 1);
assert_equals(document.getElementsByName("math")[0], ps[0]);
assert_equals(document.getElementsByName("svg").length, 1);
assert_equals(document.getElementsByName("svg")[0], ps[1]);
});
</script>
</body>
</html>