| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| var preventDefaultInputEvents = false; |
| if (!window.eventSender || !window.internals || !window.testRunner) |
| internals.settings.setInputEventsEnabled(true); |
| let input = document.querySelector("#foo"); |
| eventSender.keyDown("a", []); |
| eventSender.keyDown("b", []); |
| eventSender.keyDown("c", []); |
| preventDefaultInputEvents = true; |
| testRunner.execCommand("DeleteBackward"); |
| debug(`The final value is: ${input.value}`); |
| function checkInputEvent(event) |
| if (preventDefaultInputEvents) |
| debug("FAIL: Did not expect to the `oninput` handler to fire."); |
| function checkBeforeInputEvent(event) |
| if (preventDefaultInputEvents) { |
| debug("Fired `onbeforeinput`: preventing default!"); |
| <body onload=beginTest()> |
| <input id="foo" contenteditable value="helloworld" oninput=checkInputEvent(event) onbeforeinput=checkBeforeInputEvent(event)></div> |
| <script src="../../resources/js-test-post.js"></script> |