| <script src="../../resources/js-test.js"></script> |
| <div id="editor" contenteditable></div> |
| description('This tests the existence of the backup element queue. To manually test, press the delete key once the page is loaded.'); |
| var jsTestIsAsync = true; |
| var disconnected = false; |
| class TestElement extends HTMLElement { |
| customElements.define('test-element', TestElement); |
| var editor = document.getElementById('editor'); |
| shouldBe('constructed', 'false'); |
| shouldBe('editor.innerHTML = "a<test-element>b</test-element>c"; constructed', 'true'); |
| shouldBe('editor.focus(); getSelection().selectAllChildren(editor); disconnected', 'false'); |
| function checkDisconnectedAtEndOfMictotask() |
| shouldBe('"Before the end of the micro task"; disconnected', 'false'); |
| Promise.resolve().then(function () { |
| shouldBe('"At the end of the micro task"; disconnected', 'true'); |
| testRunner.execCommand('delete', false, null); |
| checkDisconnectedAtEndOfMictotask(); |
| editor.oninput = function () { |
| checkDisconnectedAtEndOfMictotask(); |