Skip to content

script: Fix panic when deleting after range.deleteContents#59670

Merged
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_44748
May 5, 2026
Merged

script: Fix panic when deleting after range.deleteContents#59670
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_44748

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

The state of the document after range.deleteContents leads to the delete command to traverse to the root element and then crash. Instead, we should simply stop the loop and continue the algorithm and delete backwards.

Also added an additional test I created when trying to figure out what other browsers are doing
and added spec comments to deleteContents. Lastly, also incorporate the spec fix of whatwg/dom#1452

Fixes #44742

Testing: WPT
Reviewed in servo/servo#44748

The state of the document after `range.deleteContents` leads
to the delete command to traverse to the root element and
then crash. Instead, we should simply stop the loop and
continue the algorithm and delete backwards.

Fixes web-platform-tests#44742

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync servo-wpt-sync merged commit 90dcf72 into web-platform-tests:master May 5, 2026
25 checks passed
@servo-wpt-sync servo-wpt-sync deleted the servo_export_44748 branch May 5, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants