| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../resources/js-test.js"></script> | |
| 4 </head> | |
| 5 <body> | |
| 6 <input id="input"><input id="input2"> | |
| 7 <script> | |
| 8 description("This tests inputMethodContext attribute which is an additional inte
rface for HTMLElement."); | |
| 9 | |
| 10 var html = document.documentElement; | |
| 11 | |
| 12 // Checks creating an InputMethodContext object via new throws exception. | |
| 13 shouldThrow('new InputMethodContext()'); | |
| 14 | |
| 15 // Checks existence of .inputMethodContext attribute. | |
| 16 shouldBeNonNull(html.inputMethodContext); | |
| 17 shouldBeEqualToString('typeof(html.inputMethodContext)', 'object'); | |
| 18 | |
| 19 // Checks inputMethodContext returns an InputMethodContext object. | |
| 20 var context = html.inputMethodContext; | |
| 21 shouldBeTrue('context instanceof InputMethodContext'); | |
| 22 | |
| 23 // Checks the same InputMethodContext objects are returned from an element. | |
| 24 var context2 = html.inputMethodContext; | |
| 25 shouldBeTrue('context2 instanceof InputMethodContext'); | |
| 26 shouldBeTrue('context === context2'); | |
| 27 | |
| 28 // Checks if contexts for different elements are different. | |
| 29 var inputContext = document.getElementById('input').inputMethodContext; | |
| 30 var input2Context = document.getElementById('input2').inputMethodContext; | |
| 31 shouldNotBe('inputContext', 'input2Context'); | |
| 32 </script> | |
| 33 </body> | |
| 34 </html> | |
| OLD | NEW |