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

Side by Side Diff: LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html

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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <body> 2 <body>
3 <div class="one">Line 1<div class="two">Line 2</div><p>Line <i>3</i></p></div> 3 <div class="one">Line 1<div class="two">Line 2</div><p>Line <i>3</i></p></div>
4 <div id="test" class="one two"><div class="one two">line 4</div><p class="two">l ine 5</p></div> 4 <div id="test" class="one two"><div class="one two">line 4</div><p class="two">l ine 5</p></div>
5 <p><ol id="console"></ol></p> 5 <p><ol id="console"></ol></p>
6 <script type="text/javascript"> 6 <script type="text/javascript">
7 if (window.testRunner) 7 if (window.testRunner)
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 9
10 function log(message) 10 function log(message)
11 { 11 {
12 var item = document.createElement("li"); 12 var item = document.createElement("li");
13 item.appendChild(document.createTextNode(message)); 13 item.appendChild(document.createTextNode(message));
14 document.getElementById("console").appendChild(item); 14 document.getElementById("console").appendChild(item);
15 } 15 }
16 16
17 NodeList.prototype.dump = function() 17 HTMLCollection.prototype.dump = function()
18 { 18 {
19 var result = ""; 19 var result = "";
20 var i = 0; 20 var i = 0;
21 for (; i < this.length; i++) 21 for (; i < this.length; i++)
22 result += this[i] + ", "; 22 result += this[i] + ", ";
23 result += "length: " + i; 23 result += "length: " + i;
24 return result; 24 return result;
25 } 25 }
26 26
27 try { 27 try {
(...skipping 15 matching lines...) Expand all
43 log(elm.getElementsByClassName("").dump()); 43 log(elm.getElementsByClassName("").dump());
44 log(elm.getElementsByClassName("onetwo").dump()); 44 log(elm.getElementsByClassName("onetwo").dump());
45 log(elm.getElementsByClassName(null).dump()); 45 log(elm.getElementsByClassName(null).dump());
46 log(elm.getElementsByClassName(undefined).dump()); 46 log(elm.getElementsByClassName(undefined).dump());
47 } catch (ex) { 47 } catch (ex) {
48 log("Exception: " + ex.description); 48 log("Exception: " + ex.description);
49 } 49 }
50 </script> 50 </script>
51 </body> 51 </body>
52 </html> 52 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698