| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../../../resources/js-test.js"></script> |
| <script src="../../../../resources/ui-helper.js"></script> |
| <style> |
| html, body { |
| width: 100%; |
| height: 100%; |
| margin: 0; |
| } |
| |
| textarea { |
| width: 100%; |
| height: 100px; |
| font-size: 50px; |
| text-align: center; |
| } |
| </style> |
| </head> |
| <body> |
| <textarea></textarea> |
| <pre id="description"></pre> |
| <pre id="console"></pre> |
| </body> |
| <script> |
| jsTestIsAsync = true; |
| textarea = document.querySelector("textarea"); |
| |
| description("Verifies that the keyboard shows up even after preventing default on touchstart. To manually test, tap the textarea; the textarea should remain focused, and the keyboard should appear."); |
| |
| textarea.addEventListener("touchstart", event => event.preventDefault()); |
| addEventListener("load", async () => { |
| textarea.focus(); |
| await UIHelper.activateElementAndWaitForInputSession(textarea); |
| testPassed("keyboard was shown."); |
| shouldBe("document.activeElement", "textarea"); |
| textarea.blur(); |
| await UIHelper.waitForKeyboardToHide(); |
| finishJSTest(); |
| }); |
| </script> |
| </html> |