Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / ValidityState-rangeOverflow.html
blob65094c917f77cc4b72f8bad1ad69b1ee2e45611d
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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('This test aims to check for rangeOverflow flag with input fields');
12 var input = document.createElement('input');
14 function checkNotOverflow(value, max, disabled)
16 input.value = value;
17 input.max = max;
18 input.disabled = !!disabled;
19 var overflow = input.validity.rangeOverflow;
20 var resultText = 'The value "' + input.value + '" ' +
21 (overflow ? 'overflows' : 'doesn\'t overflow') +
22 ' the maximum value "' + input.max + '"' + (disabled ? ' when disabled.' : '.');
23 if (overflow)
24 testFailed(resultText);
25 else
26 testPassed(resultText);
29 // ----------------------------------------------------------------
30 debug('Type=text');
31 input.type = 'text'; // No overflow for type=text.
32 checkNotOverflow('101', '100');
33 </script>
34 </body>
35 </html>