Skip to content

Commit

Permalink
Merge pull request #2270 from w3c/sync_ebb31be0457a9d3ec3d5d142a58720…
Browse files Browse the repository at this point in the history
…6af4c8e2a6

Merge pull request #2270 from sync_ebb31be0457a9d3ec3d5d142a587206af4c8e2a6
  • Loading branch information
jgraham committed Oct 21, 2015
2 parents e772124 + ebb31be commit ef62242
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<root/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!doctype html>
<meta charset=utf-8>
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<iframe src="Element-getElementsByTagName-change-document-HTMLNess-iframe.xml"></iframe>
<script>
onload = function() {
var parent = document.createElement("div");
var child1 = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
child1.textContent = "xhtml:a";
var child2 = document.createElementNS("http://www.w3.org/1999/xhtml", "A");
child2.textContent = "xhtml:A";
var child3 = document.createElementNS("", "a");
child3.textContent = "a";
var child4 = document.createElementNS("", "A");
child4.textContent = "A";

parent.appendChild(child1);
parent.appendChild(child2);
parent.appendChild(child3);
parent.appendChild(child4);

var list = parent.getElementsByTagName("A");
assert_array_equals(list, [child1, child4],
"In an HTML document, should lowercase the tagname passed in for HTML " +
"elements only");

frames[0].document.documentElement.appendChild(parent);
assert_array_equals(list, [child1, child4],
"After changing document, should still be lowercasing for HTML");

assert_array_equals(parent.getElementsByTagName("A"),
[child2, child4],
"New list with same root and argument should not be lowercasing now");

// Now reinsert all those nodes into the parent, to blow away caches.
parent.appendChild(child1);
parent.appendChild(child2);
parent.appendChild(child3);
parent.appendChild(child4);
assert_array_equals(list, [child1, child4],
"After blowing away caches, should still have the same list");

assert_array_equals(parent.getElementsByTagName("A"),
[child2, child4],
"New list with same root and argument should still not be lowercasing");
done();
}
</script>

0 comments on commit ef62242

Please sign in to comment.