ladybird/Tests/LibWeb/Text/input/Selection-setBaseAndExtent-without-common-root.html
Andreas Kling 416c478876 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.
2024-07-20 06:41:25 +02:00

11 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>