mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-29 12:49:05 +00:00
LibWeb: Fix nodesToRemove collecting traversal in Range::delete_contents
With this change children are no longer skipped in tree traversal when start node of range equals to end node of range. Fixes https://github.com/SerenityOS/serenity/issues/24036
This commit is contained in:
parent
cedf6dd2c3
commit
9540af6489
Notes:
sideshowbarker
2024-07-17 18:38:54 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 9540af6489
Pull-request: https://github.com/SerenityOS/serenity/pull/24038
Issue: https://github.com/SerenityOS/serenity/issues/24036
3 changed files with 19 additions and 1 deletions
17
Tests/LibWeb/Text/input/DOM/Range-deleteContents.html
Normal file
17
Tests/LibWeb/Text/input/DOM/Range-deleteContents.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
before
|
||||
<div id="for-deletion">
|
||||
<div>should</div>
|
||||
<div>be</div>
|
||||
<div>gone</div>
|
||||
</div>
|
||||
after
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const element = document.getElementById("for-deletion");
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(element);
|
||||
range.deleteContents();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue