1
0
Fork 0
firefox/testing/web-platform/tests/editing/other/selection-change-not-fired-if-selection-set-to-root.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

24 lines
No EOL
1.1 KiB
HTML

<!doctype HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="../include/editor-test-utils.js"></script>
<body>
<div contenteditable="true" id="target">
</div>
<script>
// Selectionchange event should not get fired if the selection is already set to the beginning of the root
promise_test(async () => {
let selectionChangeCount = 0;
const target = document.getElementById("target");
await new test_driver.click(target);
await EditorTestUtils.waitForRender();
document.addEventListener("selectionchange", () => ++selectionChangeCount);
await new test_driver.send_keys(target, "\uE003");
await EditorTestUtils.waitForRender();
assert_equals(selectionChangeCount, 0, "Selectionchange event should not get fired");
}, "Selectionchange event should not get fired when the selection is already set to the beginning of the root ");
</script>
</body>