Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / date / input-date-validation-message.html
bloba88bd3ca7e9c1edf7a488d261b92983c414343b6
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Test for validationMessage IDL attribute for &lt;input type=date>');
9 var parent = document.createElement('div');
10 document.body.appendChild(parent);
11 parent.innerHTML = '<input type=date id=date maxlength=1 pattern=x>';
12 var input = document.getElementById('date');
13 input.offsetLeft;
15 function testIt(value, min, max, step)
17 input.setAttribute("max", max);
18 input.setAttribute("min", min);
19 input.setAttribute("step", step);
20 input.setAttribute("value", value);
21 return input.validationMessage;
24 debug('No message')
25 shouldBeEqualToString('testIt("", "", "")', '');
27 debug('Value missing')
28 input.setAttribute("required", "");
29 shouldBeEqualToString('testIt("", "", "")', 'Please fill out this field.');
30 input.removeAttribute("required");
32 debug('Type mismatch');
33 shouldBeEqualToString('testIt("foo", "", "")', '');
35 debug('Range overflow')
36 shouldBeEqualToString('testIt("1982-11-02", "", "1970-12-31")', 'Value must be 12/31/1970 or earlier.');
38 debug('Range underflow')
39 shouldBeEqualToString('testIt("1982-11-02", "1990-05-25", "1990-12-24")', 'Value must be 05/25/1990 or later.');
41 debug('Step mismatch')
42 shouldBeEqualToString('testIt("1982-11-02", "1982-01-01", "", "123")', 'Please enter a valid value. The two nearest valid values are 09/04/1982 and 01/05/1983.');
44 </script>
45 </body>
46 </html>