OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../../fast/js/resources/js-test-pre.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 if the pattern constraint is not applied to some input types.
'); | 10 description('Check if the pattern constraint is not applied to some input types.
'); |
11 | 11 |
12 var input = document.createElement('input'); | 12 var input = document.createElement('input'); |
13 input.type = 'range'; | 13 input.type = 'range'; |
14 input.pattern = '[0-9]'; // Restrict to single digit | 14 input.pattern = '[0-9]'; // Restrict to single digit |
15 input.value = '11'; | 15 input.value = '11'; |
16 | 16 |
17 // pattern doesn't work for type=range | 17 // pattern doesn't work for type=range |
18 shouldBe('input.validity.patternMismatch', 'false'); | 18 shouldBe('input.validity.patternMismatch', 'false'); |
19 | 19 |
20 // works for type=text. | 20 // works for type=text. |
21 input.type = 'text'; | 21 input.type = 'text'; |
22 shouldBe('input.validity.patternMismatch', 'true'); | 22 shouldBe('input.validity.patternMismatch', 'true'); |
23 | 23 |
24 </script> | 24 </script> |
25 <script src="../../fast/js/resources/js-test-post.js"></script> | |
26 </body> | 25 </body> |
27 </html> | 26 </html> |
OLD | NEW |