Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: LayoutTests/fast/dom/script-tests/domListEnumeration.js

Issue 143453010: Have getElementsByClassName() / getElementsByTagName*() return an HTMLCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description( 1 description(
2 'This tests enumerating the elements of DOM lists.' 2 'This tests enumerating the elements of DOM lists.'
3 ); 3 );
4 4
5 if (window.testRunner) 5 if (window.testRunner)
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 7
8 // Create a testing environment that can be cleanup up easily. 8 // Create a testing environment that can be cleanup up easily.
9 var testingGround = document.createElement('div'); 9 var testingGround = document.createElement('div');
10 document.body.appendChild(testingGround); 10 document.body.appendChild(testingGround);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // HTMLSelectElement 87 // HTMLSelectElement
88 88
89 // ** Firefox DOESN'T include the indexGetter results in enumeration ** 89 // ** Firefox DOESN'T include the indexGetter results in enumeration **
90 // Window 90 // Window
91 91
92 setup(); 92 setup();
93 93
94 var resultArray = new Array(); 94 var resultArray = new Array();
95 95
96 // NodeList 96 // NodeList
97 var nodeList = document.getElementsByTagName('ol'); 97 var nodeList = document.querySelectorAll('ol');
98 resultArray = iterateList(nodeList); 98 resultArray = iterateList(nodeList);
99 99
100 shouldBe("resultArray.length", "5"); 100 shouldBe("resultArray.length", "5");
101 shouldBe("resultArray[0].i", "'0'"); 101 shouldBe("resultArray[0].i", "'0'");
102 shouldBe("resultArray[0].item", "nodeList.item(0)"); 102 shouldBe("resultArray[0].item", "nodeList.item(0)");
103 shouldBe("resultArray[1].i", "'1'"); 103 shouldBe("resultArray[1].i", "'1'");
104 shouldBe("resultArray[1].item", "nodeList.item(1)"); 104 shouldBe("resultArray[1].item", "nodeList.item(1)");
105 shouldBe("resultArray[2].i", "'2'"); 105 shouldBe("resultArray[2].i", "'2'");
106 shouldBe("resultArray[2].item", "nodeList.item(2)"); 106 shouldBe("resultArray[2].item", "nodeList.item(2)");
107 107
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 shouldBe("resultArray[0].i", "'0'"); 196 shouldBe("resultArray[0].i", "'0'");
197 shouldBe("resultArray[0].item", "mediaList.item(0)"); 197 shouldBe("resultArray[0].item", "mediaList.item(0)");
198 shouldBe("resultArray[1].i", "'1'"); 198 shouldBe("resultArray[1].i", "'1'");
199 shouldBe("resultArray[1].item", "mediaList.item(1)"); 199 shouldBe("resultArray[1].item", "mediaList.item(1)");
200 shouldBe("resultArray[2].i", "'2'"); 200 shouldBe("resultArray[2].i", "'2'");
201 shouldBe("resultArray[2].item", "mediaList.item(2)"); 201 shouldBe("resultArray[2].item", "mediaList.item(2)");
202 202
203 debug(""); 203 debug("");
204 204
205 document.body.removeChild(testingGround); 205 document.body.removeChild(testingGround);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698