mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Only set selection focus if an associated DOM node was found
The relation from a paintable to a DOM node is not always set.
This commit is contained in:
parent
15e3db5932
commit
fd949ee3dd
Notes:
github-actions[bot]
2024-12-10 13:55:19 +00:00
Author: https://github.com/gmta
Commit: fd949ee3dd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2844
3 changed files with 21 additions and 2 deletions
|
@ -0,0 +1,19 @@
|
|||
<script src="../include.js"></script>
|
||||
<style>
|
||||
div {
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
<div contenteditable="true">a<br><br><div id="b">b</div></div>
|
||||
<script>
|
||||
test(() => {
|
||||
var bDiv = document.querySelector('div#b');
|
||||
var bBounds = bDiv.getBoundingClientRect();
|
||||
|
||||
// Drag a selection from inside the #b div to just above it.
|
||||
internals.mouseDown(bBounds.x + 2, bBounds.y + 5);
|
||||
internals.movePointerTo(bBounds.x + 2, bBounds.y - 5);
|
||||
|
||||
println('PASS (did not crash)');
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue