| 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 <p>This test checks input's shadow root is not changed if input type is changed.
</p> | 7 <p>This test checks input's shadow root is not changed if input type is changed.
</p> |
| 8 <pre id="console"></pre> | 8 <pre id="console"></pre> |
| 9 <div id="container"></div> | 9 <div id="container"></div> |
| 10 | 10 |
| 11 <script> | 11 <script> |
| 12 var container = document.getElementById("container"); | 12 var container = document.getElementById("container"); |
| 13 | 13 |
| 14 function doTest() { | 14 function doTest() { |
| 15 if (!window.testRunner || !window.internals) | 15 if (!window.testRunner || !window.internals) |
| 16 return; | 16 return; |
| 17 | 17 |
| 18 testRunner.dumpAsText(); | |
| 19 | |
| 20 var input = document.createElement('input'); | 18 var input = document.createElement('input'); |
| 21 var inputTypes = [ | 19 var inputTypes = [ |
| 22 "hidden", "text", "search", "tel", "url", "email", "password", "datetime
", | 20 "hidden", "text", "search", "tel", "url", "email", "password", "datetime
", |
| 23 "date", "month", "week", "time", "datetime-local", "number", "range", | 21 "date", "month", "week", "time", "datetime-local", "number", "range", |
| 24 "color", "checkbox", "radio", "file", "submit", "image", "reset", "butto
n" | 22 "color", "checkbox", "radio", "file", "submit", "image", "reset", "butto
n" |
| 25 ]; | 23 ]; |
| 26 | 24 |
| 27 shadow = internals.shadowRoot(input); | 25 shadow = internals.shadowRoot(input); |
| 28 for (var i = 0; i < inputTypes.length; ++i) { | 26 for (var i = 0; i < inputTypes.length; ++i) { |
| 29 input.type = inputTypes[i]; | 27 input.type = inputTypes[i]; |
| 30 | 28 |
| 31 newShadow = internals.shadowRoot(input); | 29 newShadow = internals.shadowRoot(input); |
| 32 | 30 |
| 33 debug(inputTypes[i]); | 31 debug(inputTypes[i]); |
| 34 shouldBe("newShadow", "shadow"); | 32 shouldBe("newShadow", "shadow"); |
| 35 } | 33 } |
| 36 } | 34 } |
| 37 | 35 |
| 38 doTest(); | 36 doTest(); |
| 39 var successfullyParsed = true; | 37 var successfullyParsed = true; |
| 40 </script> | 38 </script> |
| 41 </body> | 39 </body> |
| 42 </html> | 40 </html> |
| OLD | NEW |