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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/range/ValidityState-stepMismatch-range.html

Issue 2366753004: input[type=range]: Updating step attribute should align the value to steps. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/range/ValidityState-stepMismatch-range-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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description('Check stepMismatch results for type=range.'); 10 description('Check stepMismatch results for type=range.');
(...skipping 17 matching lines...) Expand all
28 debug('Integers'); 28 debug('Integers');
29 shouldBe('stepMismatchFor("1", "2", "0")', 'false'); 29 shouldBe('stepMismatchFor("1", "2", "0")', 'false');
30 shouldBe('stepMismatchFor("-3", "2", "-4")', 'false'); 30 shouldBe('stepMismatchFor("-3", "2", "-4")', 'false');
31 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'false'); 31 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'false');
32 shouldBe('input.value', '"3"'); // Different from type=number. 32 shouldBe('input.value', '"3"'); // Different from type=number.
33 debug('Invalid step values'); 33 debug('Invalid step values');
34 input.max = ''; 34 input.max = '';
35 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false'); 35 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');
36 shouldBe('stepMismatchFor("-3", null, "-4")', 'false'); 36 shouldBe('stepMismatchFor("-3", null, "-4")', 'false');
37 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false'); 37 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');
38
39 debug('Updating step attribute');
40 stepMismatchFor('50', '10', '0');
41 shouldBeEqualToString('input.value', '50');
42 shouldBeEqualToString('input.step = "15"; input.value', '45');
43 shouldBeEqualToString('input.step = "20"; input.value', '40');
44 stepMismatchFor('50', '10', '0');
45 shouldBeEqualToString('input.value = "5", input.value', '10');
46 shouldBeEqualToString('input.step = "6"; input.value', '12');
47
38 debug('Huge numbers and small step; uncomparable'); 48 debug('Huge numbers and small step; uncomparable');
39 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false'); 49 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');
40 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false'); 50 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');
41 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false'); 51 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');
42 debug('Huge numbers and huge step'); 52 debug('Huge numbers and huge step');
43 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false'); 53 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');
44 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'false'); 54 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'false');
45 debug('Fractional numbers'); 55 debug('Fractional numbers');
46 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false'); 56 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');
47 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'false'); 57 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'false');
48 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false'); 58 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false');
49 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false'); 59 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false');
50 debug('Disabled'); 60 debug('Disabled');
51 shouldBe('stepMismatchFor("1", "2", "0", true)', 'false'); 61 shouldBe('stepMismatchFor("1", "2", "0", true)', 'false');
52 </script> 62 </script>
53 </body> 63 </body>
54 </html> 64 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/range/ValidityState-stepMismatch-range-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698