Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / input-inputmode.html
blob4ffb56584f96e62eb3e6bcd42aff0f0877ef0dba
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Tests the behavior of .inputMode of HTMLInputElement.');
10 var input = document.createElement('input');
12 // .inputMode just reflect the corresponding attributes.
13 input.type = 'text';
14 shouldBe('input.inputMode', '""');
15 input.setAttribute('inputmode', '0');
16 shouldBe('input.inputMode', '"0"');
17 input.setAttribute('inputmode', 'abc');
18 shouldBe('input.inputMode', '"abc"');
20 input.inputMode = 'foo';
21 shouldBe('input.getAttribute("inputmode")', '"foo"');
23 input.inputMode = '';
24 shouldBe('input.getAttribute("inputmode")', '""');
26 // Null.
27 debug('Setting null to inputMode:');
28 input.inputMode = null;
29 shouldBe('input.inputMode', '"null"');
30 shouldBe('input.getAttribute("inputmode")', '"null"');
31 input.setAttribute('inputmode', null);
32 shouldBe('input.inputMode', '"null"');
34 // Undefined.
35 debug('Setting undefined to inputMode:');
36 input.inputMode = undefined;
37 shouldBe('input.inputMode', '"undefined"');
38 shouldBe('input.getAttribute("inputmode")', '"undefined"');
39 input.setAttribute('inputmode', undefined);
40 shouldBe('input.inputMode', '"undefined"');
42 // Non-string.
43 debug('Setting non-string to inputMode:');
44 input.inputMode = 256;
45 shouldBe('input.inputMode', '"256"');
46 shouldBe('input.getAttribute("inputmode")', '"256"');
47 input.setAttribute('inputmode', 256);
48 shouldBe('input.inputMode', '"256"');
50 </script>
51 </body>
52 </html>