mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWeb/Editing: Pass normalized command name to editing AOs
As the internal algorithms perform case sensitive matching. Fixes a crash in the included test, seen on gmail.com.
This commit is contained in:
parent
70abe99bfd
commit
7c7fec5e00
Notes:
github-actions[bot]
2025-05-26 21:37:48 +00:00
Author: https://github.com/shannonbooth
Commit: 7c7fec5e00
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4875
Reviewed-by: https://github.com/gmta ✅
3 changed files with 28 additions and 7 deletions
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<div id="editor" contenteditable="true">
|
||||
This is <span id="target">some text</span> to test.
|
||||
</div>
|
||||
<script>
|
||||
test(() => {
|
||||
const target = document.getElementById("target");
|
||||
const range = document.createRange();
|
||||
const selection = window.getSelection();
|
||||
|
||||
// println(`strikeThrough active?: ${document.queryCommandState("strikeThrough")}`);
|
||||
range.selectNodeContents(target);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
document.execCommand("strikeThrough");
|
||||
|
||||
println(`strikeThrough active?: ${document.queryCommandState("strikeThrough")}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue