Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / time / time-validity-stepmismatch.html
blobf2ed8b25828831d63939870605f413b59ceeef6f
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description('Check stepMismatch results for type=time.');
12 var input = document.createElement('input');
13 document.body.appendChild(input);
15 function stepMismatchFor(value, step, min, disabled) {
16 input.min = min;
17 input.step = step;
18 input.value = value;
19 input.disabled = !!disabled;
20 return input.validity.stepMismatch;
23 input.type = 'time';
24 debug('Empty values');
25 shouldBeFalse('stepMismatchFor("", null, null)');
26 shouldBeFalse('stepMismatchFor("", "2", "12:34:56")');
27 debug('Normal step values');
28 shouldBeFalse('stepMismatchFor("12:34:55", "1", "12:34:56")');
29 shouldBeTrue('stepMismatchFor("12:34:55.001", "1", "12:34:56")');
30 shouldBeFalse('stepMismatchFor("12:34:56.001", "0.001", "12:34:56")');
31 shouldBeTrue('stepMismatchFor("12:34:55", "0.333", "12:34:56")');
32 shouldBeFalse('stepMismatchFor("12:34:55.001", "0.333", "12:34:56")');
33 shouldBeFalse('stepMismatchFor("12:34", "86400", "12:34")');
34 shouldBeTrue('stepMismatchFor("23:59:59.998", "86399.999", "00:00")');
35 shouldBeFalse('stepMismatchFor("23:59:59.999", "86399.999", "00:00")');
36 debug('Implicit step base');
37 shouldBeFalse('stepMismatchFor("12:34", "120", null)');
38 shouldBeTrue('stepMismatchFor("12:35", "120", null)');
39 debug('Small step values');
40 shouldBeFalse('stepMismatchFor("12:34:55.001", "0.0003", "12:34.55.000")');
41 shouldBeTrue('stepMismatchFor("12:34:55.001", "0.0019", "12:34.55.000")');
42 shouldBeFalse('stepMismatchFor("12:34:55.004", "0.0019", "12:34.55.000")');
43 debug('Invalid or no step values');
44 shouldBeFalse('stepMismatchFor("12:34", null, "12:34")');
45 shouldBeTrue('stepMismatchFor("12:34:56", null, "12:34")');
46 shouldBeFalse('stepMismatchFor("12:34", "-1", "12:34")');
47 shouldBeFalse('stepMismatchFor("12:34", "foo", "12:34")');
48 debug('Special step value');
49 shouldBeFalse('stepMismatchFor("12:35", "any", "12:34")');
50 debug('Disabled');
51 shouldBeFalse('stepMismatchFor("12:34:55.001", "1", "12:34:56", true)');
53 debug('');
54 </script>
55 </body>
56 </html>