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

Side by Side Diff: LayoutTests/fast/forms/form-collection-radio-node-list.html

Issue 119063002: Have HTMLFormElement's named getter return a RadioNodeList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expected output for inspector/console/console-format-collections Created 7 years 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <p id="description"></p> 5 <p id="description"></p>
6 <div id="divId"> 6 <div id="divId">
7 <form id="form1"> 7 <form id="form1">
8 <button id=button1></button> 8 <button id=button1></button>
9 <fieldset id=fieldset1><legend id=legend1></legend></fieldset> 9 <fieldset id=fieldset1><legend id=legend1></legend></fieldset>
10 <input id=inputhidden type=hidden> 10 <input id=inputhidden type=hidden>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 shouldBe('elementsList[13].checked = true; radioNodeList.value', "'inputRadioVal ue'"); 110 shouldBe('elementsList[13].checked = true; radioNodeList.value', "'inputRadioVal ue'");
111 shouldBe('elementsList[13].type = "date"; radioNodeList.value', "''"); 111 shouldBe('elementsList[13].type = "date"; radioNodeList.value', "''");
112 112
113 debug(""); 113 debug("");
114 debug("Check second RadioNodeList is also created properly"); 114 debug("Check second RadioNodeList is also created properly");
115 var radioNodeList2 = elementsList.namedItem("commoninput"); 115 var radioNodeList2 = elementsList.namedItem("commoninput");
116 shouldBe('radioNodeList2.length', '3'); 116 shouldBe('radioNodeList2.length', '3');
117 117
118 shouldBe('radioNodeList2[0].type', "'text'"); 118 shouldBe('radioNodeList2[0].type', "'text'");
119 shouldBe('radioNodeList2[1].type', "'email'"); 119 shouldBe('radioNodeList2[1].type', "'email'");
120 var resetElement = radioNodeList2[2];
120 shouldBe('radioNodeList2[2].type', "'reset'"); 121 shouldBe('radioNodeList2[2].type', "'reset'");
121 radioNodeList2[2].id = "idChanged"; 122 radioNodeList2[2].id = "idChanged";
122 debug("After changing the id"); 123 debug("After changing the id");
123 shouldBe('radioNodeList2.length', '2'); 124 shouldBe('radioNodeList2.length', '2');
125 // reset for use below.
126 resetElement.id = "commoninput";
esprehn 2013/12/19 11:02:48 I'd rather you just added a new test instead of ha
sof 2013/12/19 12:15:05 ok, i've reverted this extra test over the form's
127 debug("After resetting the id");
128 shouldBe('radioNodeList2.length', '3');
129 debug("");
130
131 debug("Check RadioNodeList created from a form element");
132 var radioNodeList3 = owner["commoninput"];
133 shouldBe('radioNodeList3.length', '3');
134
135 shouldBe('radioNodeList3[0].type', "'text'");
136 shouldBe('radioNodeList3[1].type', "'email'");
137 var resetElement = radioNodeList3[2];
138 shouldBe('radioNodeList3[2].type', "'reset'");
139 radioNodeList3[2].id = "idChanged";
140 debug("After changing the id");
141 shouldBe('radioNodeList3.length', '2');
142 resetElement.id = "commoninput";
143 debug("After resetting the id");
144 shouldBe('radioNodeList3.length', '3');
124 debug(""); 145 debug("");
125 146
126 debug("Check that object element also reflects in RadioNodeList."); 147 debug("Check that object element also reflects in RadioNodeList.");
127 document.getElementById("object1").id = "inputcommon"; 148 document.getElementById("object1").id = "inputcommon";
128 shouldBe('radioNodeList.length', '5'); 149 shouldBe('radioNodeList.length', '5');
129 150
130 debug(""); 151 debug("");
131 debug("Check that object element does not reflect in RadioNodeList if its owner form is not present."); 152 debug("Check that object element does not reflect in RadioNodeList if its owner form is not present.");
132 var nonSubtreeObjectElement = document.createElement("object"); 153 var nonSubtreeObjectElement = document.createElement("object");
133 nonSubtreeObjectElement.setAttribute("id", "inputcommon"); 154 nonSubtreeObjectElement.setAttribute("id", "inputcommon");
134 shouldBe('container.appendChild(nonSubtreeObjectElement); radioNodeList.length', '5'); 155 shouldBe('container.appendChild(nonSubtreeObjectElement); radioNodeList.length', '5');
135 156
136 container.parentNode.removeChild(container); 157 container.parentNode.removeChild(container);
137 </script> 158 </script>
138 </body> 159 </body>
139 </html> 160 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698