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

Side by Side Diff: LayoutTests/fast/forms/form-radio-img-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: Test style adjustments + const'ify new RadioNodeList field. 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
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-radio-img-node-list-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
(Empty)
1 <!doctype html>
2 <script src="../../resources/js-test.js"></script>
3 <form id="f1">
4 <button id=n1></button>
5 <keygen id=n1></keygen>
6 <output id=n1></output>
7 <object name=n1></object>
8 <select name=n1><option id=n1></option></select>
9 <input name=n1 type=hidden>
10 <input name=n1 type=image>
11 <input name=n1 type=text>
12 <input name=n2 type=image>
13 <img name=n2></img>
14 <img id=n2></img>
15 </form>
16 <script>
17 description("Test RadioNodeLists returned by the HTMLFormElement named-getter.") ;
18
19 var radioNodeList;
20
21 function shouldBeImgElement(n) {
22 shouldBeTrue("radioNodeList[" + n + "] instanceof HTMLImageElement");
23 }
24
25 function verifyLength(n) {
26 shouldBe("radioNodeList.length", n.toString());
27 for (var i = 0; i < n; i++)
28 shouldBeImgElement(i);
29 }
30
31 debug("Check that if no 'listed elements' match by name, img elements are picked instead.");
32
33 var form = document.getElementById("f1");
34 radioNodeList = form["n2"];
35 verifyLength(2);
36
37 var button = document.createElement("button");
38 button.name = "n2";
39 form.appendChild(button);
40 verifyLength(2);
41
42 var img = document.createElement("img");
43 img.name = "n2";
44 form.appendChild(img);
45 verifyLength(3);
46 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-radio-img-node-list-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698