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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/form-radio-img-node-list.html
diff --git a/LayoutTests/fast/forms/form-radio-img-node-list.html b/LayoutTests/fast/forms/form-radio-img-node-list.html
new file mode 100644
index 0000000000000000000000000000000000000000..6f8f9e2fcd2eb211eca6a8f20832f227b60fdc4d
--- /dev/null
+++ b/LayoutTests/fast/forms/form-radio-img-node-list.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<script src="../../resources/js-test.js"></script>
+<form id="f1">
+ <button id=n1></button>
+ <keygen id=n1></keygen>
+ <output id=n1></output>
+ <object name=n1></object>
+ <select name=n1><option id=n1></option></select>
+ <input name=n1 type=hidden>
+ <input name=n1 type=image>
+ <input name=n1 type=text>
+ <input name=n2 type=image>
+ <img name=n2></img>
+ <img id=n2></img>
+</form>
+<script>
+description("Test RadioNodeLists returned by the HTMLFormElement named-getter.");
+
+var radioNodeList;
+
+function shouldBeImgElement(n) {
+ shouldBeTrue("radioNodeList[" + n + "] instanceof HTMLImageElement");
+}
+
+function verifyLength(n) {
+ shouldBe("radioNodeList.length", n.toString());
+ for (var i = 0; i < n; i++)
+ shouldBeImgElement(i);
+}
+
+debug("Check that if no 'listed elements' match by name, img elements are picked instead.");
+
+var form = document.getElementById("f1");
+radioNodeList = form["n2"];
+verifyLength(2);
+
+var button = document.createElement("button");
+button.name = "n2";
+form.appendChild(button);
+verifyLength(2);
+
+var img = document.createElement("img");
+img.name = "n2";
+form.appendChild(img);
+verifyLength(3);
+</script>
« 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