Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-valueasnumber-unsupported.html
blobc97df90f6d27bcdcc63daf42b46475a97e34427e
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('Tests for .valueAsNumber with non-supported input types.');
12 var input = document.createElement('input');
13 input.type = 'range';
14 document.body.appendChild(input);
16 function checkValueAsNumber(type) {
17 debug('Check for type=' + type);
18 input.type = type;
19 // Not allowed to set the value of file to anything except empty string.
20 input.value = (type == 'file') ? '' : '0';
21 shouldBe('input.valueAsNumber', 'Number.NaN');
22 shouldThrow('input.valueAsNumber = 0', '"InvalidStateError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\': This input element does not support Number values."');
25 checkValueAsNumber('button');
26 checkValueAsNumber('checkbox');
27 checkValueAsNumber('color');
28 checkValueAsNumber('email');
29 checkValueAsNumber('file');
30 checkValueAsNumber('hidden');
31 checkValueAsNumber('image');
32 checkValueAsNumber('khtml_isindex');
33 checkValueAsNumber('password');
34 checkValueAsNumber('radio');
35 checkValueAsNumber('reset');
36 checkValueAsNumber('search');
37 checkValueAsNumber('submit');
38 checkValueAsNumber('tel');
39 checkValueAsNumber('text');
40 checkValueAsNumber('url');
41 </script>
42 </body>
43 </html>