-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2270 from w3c/sync_ebb31be0457a9d3ec3d5d142a58720…
…6af4c8e2a6 Merge pull request #2270 from sync_ebb31be0457a9d3ec3d5d142a587206af4c8e2a6
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<root/> |
50 changes: 50 additions & 0 deletions
50
dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |