mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Refuse to recursively execute .execCommand()
Spec issue: https://github.com/w3c/editing/issues/477
This commit is contained in:
committed by
Andreas Kling
parent
0c854f9afc
commit
f731cffbd8
Notes:
github-actions[bot]
2025-01-24 22:54:31 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/f731cffbd89 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3352
@@ -0,0 +1,20 @@
|
||||
<script src="../include.js"></script>
|
||||
<div contenteditable="true"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
const range = document.createRange();
|
||||
getSelection().addRange(range);
|
||||
|
||||
const divElm = document.querySelector('div');
|
||||
range.setStart(divElm, 0);
|
||||
range.setEnd(divElm, 0);
|
||||
|
||||
divElm.addEventListener('input', () => {
|
||||
println('input event');
|
||||
println(`inner result: ${document.execCommand('insertText', false, 'bar')}`);
|
||||
});
|
||||
|
||||
println(`outer result: ${document.execCommand('insertText', false, 'foo')}`);
|
||||
println(divElm.innerHTML);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user