chromium/third_party/blink/web_tests/external/wpt/html/syntax/parsing/Element.getElementsByTagName-foreign-02.html

<!doctype html>
<title>getElementsByTagName and font</title>
<link rel="author" title="Ms2ger" href="mailto:[email protected]">
<link rel="help" href="https://dom.spec.whatwg.org/#dom-element-getelementsbytagname">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#parsing">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<svg id="outer">
<foreignObject>
<font></font>
<svg><font/></svg>
</foreignObject>
</svg>
</div>
<script>
var HTML = "http://www.w3.org/1999/xhtml", SVG = "http://www.w3.org/2000/svg";
var wrapper = document.getElementById("outer");
test(function() {
  assert_equals(wrapper.getElementsByTagName("FONT").length, 1);
  assert_equals(wrapper.getElementsByTagName("FONT")[0].namespaceURI, HTML);
}, "Upper-case font")
test(function() {
  assert_equals(wrapper.getElementsByTagName("font").length, 2);
  assert_equals(wrapper.getElementsByTagName("font")[0].namespaceURI, HTML);
  assert_equals(wrapper.getElementsByTagName("font")[1].namespaceURI, SVG);
}, "Lower-case font")
</script>