| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="../../resources/js-test-pre.js"></script> | |
| <script src="resources/common-setrangetext.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| description("Test setRangeText() method on common input types."); | |
| runTestsShouldPass("input", { type: "password" }); | |
| runTestsShouldPass("input", { type: "tel" }); | |
| runTestsShouldPass("input", { type: "text" }); | |
| runTestsShouldPass("input", { type: "text", dir: "rtl" }); | |
| runTestsShouldPass("input", { type: "url" }); | |
| debug("<hr>"); | |
| debug("Check that setRangeText() on disconnected elements doesn't crash and has proper values."); | |
| element = document.createElement("input"); | |
| evalAndLog("element.value = '0123456789'"); | |
| evalAndLog("element.setRangeText('ABC', 0, 0, 'select')"); | |
| shouldBeEqualToString("element.value", "ABC0123456789"); | |
| runTestsShouldFail("input", { type: "button" }); | |
| runTestsShouldFail("input", { type: "checkbox" }); | |
| runTestsShouldFail("input", { type: "email" }); | |
| runTestsShouldFail("input", { type: "radio" }); | |
| runTestsShouldFail("input", { type: "reset" }); | |
| runTestsShouldFail("input", { type: "submit" }); | |
| </script> | |
| <script src="../../resources/js-test-post.js"></script> | |
| </body> | |
| </html> |