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

Side by Side Diff: LayoutTests/fast/forms/input-appearance-selection.html

Issue 1269263003: The start and end arguments should be unsigned long in setSelectionRange() function Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 function test () { 4 function test () {
5 var testField = document.getElementById('t1'); 5 var testField = document.getElementById('t1');
6 var results = document.getElementById('result'); 6 var results = document.getElementById('result');
7 7
8 testSelectionRange(1, 0, 0, 0, 0, testField, results); 8 testSelectionRange(1, 0, 0, 0, 0, testField, results);
9 testSelectionEnd(2, 17, 0, 17, testField, results); 9 testSelectionEnd(2, 17, 0, 17, testField, results);
10 testSelectionStart(3, 1, 1, 17, testField, results); 10 testSelectionStart(3, 1, 1, 17, testField, results);
11 testSelectionRange(4, 10, 3, 3, 3, testField, results); 11 testSelectionRange(4, 10, 3, 3, 3, testField, results);
12 testSelectionEnd(5, 2, 2, 2, testField, results); 12 testSelectionEnd(5, 2, 2, 2, testField, results);
13 testSelectionRange(6, 5, 4, 4, 4, testField, results); 13 testSelectionRange(6, 5, 4, 4, 4, testField, results);
14 testSelectionRange(7, -5, -4, 0, 0, testField, results); 14 testSelectionRange(7, -5, -4, 20, 20, testField, results);
15 testSelectionRange(8, -5, 80, 0, 20, testField, results); 15 testSelectionRange(8, -5, 80, 20, 20, testField, results);
16 testSelectionRange(9, 3, 12, 3, 12, testField, results); 16 testSelectionRange(9, 3, 12, 3, 12, testField, results);
17 17
18 } 18 }
19 19
20 function testSelectionRange (testNumber, start, end, expectedStart, expectedEnd, tf, res) 20 function testSelectionRange (testNumber, start, end, expectedStart, expectedEnd, tf, res)
21 { 21 {
22 tf.focus(); 22 tf.focus();
23 tf.setSelectionRange(start, end); 23 tf.setSelectionRange(start, end);
24 res.innerHTML = res.innerHTML + "<br>Test " + testNumber + ": setSelectionRa nge(" + start + ", " + end + ")"; 24 res.innerHTML = res.innerHTML + "<br>Test " + testNumber + ": setSelectionRa nge(" + start + ", " + end + ")";
25 if (tf.selectionStart == expectedStart && tf.selectionEnd == expectedEnd) 25 if (tf.selectionStart == expectedStart && tf.selectionEnd == expectedEnd)
(...skipping 25 matching lines...) Expand all
51 </script> 51 </script>
52 </head> 52 </head>
53 <body onload="test()"> 53 <body onload="test()">
54 This tests the selection methods on the new text field. 54 This tests the selection methods on the new text field.
55 <p> 55 <p>
56 <input type="text" id="t1" style="-khtml-appearance:textfield" value="123456789 ABCDEFGHIJ"></input> 56 <input type="text" id="t1" style="-khtml-appearance:textfield" value="123456789 ABCDEFGHIJ"></input>
57 <div id="result"></div> 57 <div id="result"></div>
58 </p> 58 </p>
59 </body> 59 </body>
60 </html> 60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698