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

Side by Side Diff: LayoutTests/fast/forms/select-max-length.html

Issue 1291263003: Index setter of HTMLSelectElement and HTMLOptionsCollection should do nothing if the requested size… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update warning messages Created 5 years, 4 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 <p>This test that setting HTMLSelectElement.length is capped to 10,000, but that you can add additional Option elements by calling add.</p> 1 <p>This test that setting HTMLSelectElement.length is capped to 10,000, but that you can add additional Option elements by calling add.</p>
2 <pre id="console"></pre> 2 <div id="console"></div>
3 <select id="theSelect"></select> 3 <select id="theSelect"></select>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 var sel = document.getElementById('theSelect');
7 shouldBe('sel.length', '0');
4 8
5 <script> 9 debug('Trying: - sel.length = 20000;');
6 if (window.testRunner) 10 sel.length = 20000;
7 testRunner.dumpAsText(); 11 shouldBe('sel.length', '0');
8 12
9 function log(msg) 13 debug('Trying: - sel.add(new Option, 0);');
10 { 14 sel.add(new Option, 0);
11 document.getElementById("console").appendChild(document.createTextNode(m sg + "\n")); 15 shouldBe('sel.length', '1');
12 }
13 16
14 var sel = document.getElementById('theSelect'); 17 debug('Trying: - sel.length = 0;');
15 log("Select length is " + sel.length); 18 sel.length = 0;
19 shouldBe('sel.length', '0');
16 20
17 log("Trying: - sel.length = 20000;"); 21 debug('Index setter:');
18 sel.length = 20000; 22 shouldBe('sel[20000] = new Option(); sel.length', '0');
19 log("Select length is " + sel.length); 23 shouldBe('sel.options[20000] = new Option(); sel.length', '0');
20
21 log("Trying: - sel.add(new Option, 0);");
22 sel.add(new Option, 0);
23 log("Select length is " + sel.length);
24
25 log("Trying: - sel.length = 0;");
26 sel.length = 0;
27 log("Select length is " + sel.length);
28 </script> 24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698