mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
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.
This commit is contained in:
parent
4e0edd42b9
commit
416c478876
Notes:
github-actions[bot]
2024-07-20 07:31:52 +00:00
Author: https://github.com/awesomekling
Commit: 416c478876
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/721
3 changed files with 13 additions and 1 deletions
|
@ -0,0 +1,11 @@
|
|||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue