| OLD | NEW | 
|---|
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> | 
| 2 <html> | 2 <html> | 
| 3 <head> | 3 <head> | 
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> | 
| 5 </head> | 5 </head> | 
| 6 <body> | 6 <body> | 
| 7 <script> | 7 <script> | 
| 8 description('Tests the behavior of .inputMode of HTMLInputElement.'); | 8 description('Tests the behavior of .inputMode of HTMLInputElement.'); | 
| 9 | 9 | 
| 10 var input = document.createElement('input'); | 10 var input = document.createElement('input'); | 
| 11 | 11 | 
| 12 // .inputMode just reflect the corresponding attributes. | 12 // .inputMode just reflect the corresponding attributes. | 
| 13 input.type = 'text'; | 13 input.type = 'text'; | 
| 14 shouldBe('input.inputMode', '""'); | 14 shouldBe('input.inputMode', '""'); | 
| 15 input.setAttribute('inputmode', '0'); | 15 input.setAttribute('inputmode', '0'); | 
| 16 shouldBe('input.inputMode', '"0"'); | 16 shouldBe('input.inputMode', '"0"'); | 
| 17 input.setAttribute('inputmode', 'abc'); | 17 input.setAttribute('inputmode', 'abc'); | 
| 18 shouldBe('input.inputMode', '"abc"'); | 18 shouldBe('input.inputMode', '"abc"'); | 
| 19 | 19 | 
| 20 input.inputMode = 'foo'; | 20 input.inputMode = 'foo'; | 
| 21 shouldBe('input.getAttribute("inputmode")', '"foo"'); | 21 shouldBe('input.getAttribute("inputmode")', '"foo"'); | 
| 22 | 22 | 
| 23 input.inputMode = ''; | 23 input.inputMode = ''; | 
| 24 shouldBe('input.getAttribute("inputmode")', '""'); | 24 shouldBe('input.getAttribute("inputmode")', '""'); | 
| 25 | 25 | 
| 26 // Null. | 26 // Null. | 
| 27 debug('Setting null to inputMode:'); | 27 debug('Setting null to inputMode:'); | 
| 28 input.inputMode = null; | 28 input.inputMode = null; | 
| 29 shouldBe('input.inputMode', '""'); | 29 shouldBe('input.inputMode', '"null"'); | 
| 30 shouldBe('input.getAttribute("inputmode")', 'null'); | 30 shouldBe('input.getAttribute("inputmode")', '"null"'); | 
| 31 input.setAttribute('inputmode', null); | 31 input.setAttribute('inputmode', null); | 
| 32 shouldBe('input.inputMode', '"null"'); | 32 shouldBe('input.inputMode', '"null"'); | 
| 33 | 33 | 
| 34 // Undefined. | 34 // Undefined. | 
| 35 debug('Setting undefined to inputMode:'); | 35 debug('Setting undefined to inputMode:'); | 
| 36 input.inputMode = undefined; | 36 input.inputMode = undefined; | 
| 37 shouldBe('input.inputMode', '"undefined"'); | 37 shouldBe('input.inputMode', '"undefined"'); | 
| 38 shouldBe('input.getAttribute("inputmode")', '"undefined"'); | 38 shouldBe('input.getAttribute("inputmode")', '"undefined"'); | 
| 39 input.setAttribute('inputmode', undefined); | 39 input.setAttribute('inputmode', undefined); | 
| 40 shouldBe('input.inputMode', '"undefined"'); | 40 shouldBe('input.inputMode', '"undefined"'); | 
| 41 | 41 | 
| 42 // Non-string. | 42 // Non-string. | 
| 43 debug('Setting non-string to inputMode:'); | 43 debug('Setting non-string to inputMode:'); | 
| 44 input.inputMode = 256; | 44 input.inputMode = 256; | 
| 45 shouldBe('input.inputMode', '"256"'); | 45 shouldBe('input.inputMode', '"256"'); | 
| 46 shouldBe('input.getAttribute("inputmode")', '"256"'); | 46 shouldBe('input.getAttribute("inputmode")', '"256"'); | 
| 47 input.setAttribute('inputmode', 256); | 47 input.setAttribute('inputmode', 256); | 
| 48 shouldBe('input.inputMode', '"256"'); | 48 shouldBe('input.inputMode', '"256"'); | 
| 49 | 49 | 
| 50 </script> | 50 </script> | 
| 51 </body> | 51 </body> | 
| 52 </html> | 52 </html> | 
| OLD | NEW | 
|---|