Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / number / number-outofrange.html
blobf526be79e759c7901fc2e0715fb303d87940b606
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 spinbutton behavior for out-of-range values.');
10 var parent = document.createElement('div');
11 document.body.appendChild(parent);
12 parent.innerHTML = '<input type=number id=lower value=-10 min=0 max=100>'
13 + '<input type=number id=higher value=200 min=0 max=100>';
14 var lower = document.getElementById('lower');
15 var higher = document.getElementById('higher');
17 function sendKeyEvent(element, key)
19 element.focus();
20 var event = document.createEvent('KeyboardEvents');
21 event.initKeyboardEvent('keydown', true, true, document.defaultView, key, 0, false, false, false, false, false);
22 element.dispatchEvent(event);
25 debug('Pressing the down arrow key on an input field of which value is lower than the minimum:');
26 sendKeyEvent(lower, 'Down');
27 var unchanged = "-10";
28 shouldBe('lower.value', 'unchanged');
30 debug('Pressing the up arrow key on the input:');
31 sendKeyEvent(lower, 'Up');
32 shouldBe('lower.value', 'lower.min');
34 debug('Pressing the up arrow key on an input field of which value is higher than the maximum:');
35 sendKeyEvent(higher, 'Up');
36 unchanged = "200";
37 shouldBe('higher.value', 'unchanged');
39 debug('Pressing the down arrow key on the input:');
40 sendKeyEvent(higher, 'Down');
41 shouldBe('higher.value', 'higher.max');
43 parent.innerHTML = '';
44 </script>
45 </body>
46 </html>