Files
serenity/Tests/LibWeb/Text/input/Selection-setBaseAndExtent-without-common-root.html
Andreas Kling 1484dbffae LibWeb: Don't try to set selection with anchor/focus in different roots
If the anchor and focus nodes are not within the same document, we can't
use them for a selection range.

Found by Domato.

(cherry picked from commit 416c4788763baa778465d1d004080d322462c0bf)
2024-07-21 14:07:57 -04:00

12 lines
360 B
HTML

<body>
<script src="include.js"></script>
<script>
test(() => {
let newDoc = document.implementation.createHTMLDocument("foo");
let newDocP = newDoc.createElement("p");
let selection = window.getSelection();
selection.setBaseAndExtent(document.body, 0, newDocP, 0);
println("PASS (Didn't crash)");
});
</script>