4 <script src=
"../../resources/js-test.js"></script>
8 description('Tests the behavior of .inputMode of HTMLInputElement.');
10 var input
= document
.createElement('input');
12 // .inputMode just reflect the corresponding attributes.
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"');
24 shouldBe('input.getAttribute("inputmode")', '""');
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"');
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"');
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"');