serenity
serenity copied to clipboard
LibWeb: Use correct offset value when replacing character data
Previously, the range's end offset was being set using it's previous value.
This fixes an issue where editing contenteditable
elements would crash intermittently when removing characters.
Tested by editing the following test page:
<!DOCTYPE html>
<div contenteditable>Deleting characters from here causes intermittent crashes</div>
Is it possible to add a Text test for it?
Is it possible to add a Text test for it?
I've added a test case that exposes the bug. The test throws a DOMException on master
rather than crashing WebContent like editing a contenteditable
does. I believe the root cause is the same though.