mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-19 08:51:57 +00:00
LibWeb/Editing: Handle no active range in queryCommandState
Fixes a crash when this is invoked if no range is active for the document.
This commit is contained in:
parent
7c7fec5e00
commit
556acd82ee
Notes:
github-actions[bot]
2025-05-26 21:37:43 +00:00
Author: https://github.com/shannonbooth
Commit: 556acd82ee
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4875
Reviewed-by: https://github.com/gmta ✅
3 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
|||
const range = document.createRange();
|
||||
const selection = window.getSelection();
|
||||
|
||||
// println(`strikeThrough active?: ${document.queryCommandState("strikeThrough")}`);
|
||||
println(`strikeThrough active?: ${document.queryCommandState("strikeThrough")}`);
|
||||
range.selectNodeContents(target);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue