Files
sousa-gecko/testing/web-platform/tests/editing/crashtests
Tim van der Lippe 13556969ab Bug 2052651 [wpt PR 61075] - script: Do not crash with delete command when cursor is at start of the editing host, a=testonly
Automatic update from web-platform-tests
script: Do not crash with delete command when cursor is at start of the editing host

It currently is not possible to distinguish between the two scenarios:

1. We select the full editing host with
   `selection.collapse(editingHost)`
2. We set the cursor to just before the first child of the editing host

In both cases, the start container is the editing host and the index is
zero. Other browsers do not enable the command in the second case, but
keep it enabled (and do nothing) in the first case.

For now, to avoid crashes, we mimic browser behavior for determining
whether the command is enabled by traversing the indices and check if
we are at the start of the editing host. Unfortunately this regresses
the WPT test that checks if the full empty editing host can be deleted,
but that requires the non-standard concept of anchor position type that
Chromium has.

Fixes #46235

Testing: adds a new crashtest

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

--

wpt-commits: 9872a96e261f5bad9507ab2b896c954fbe407dd7
wpt-pr: 61075
2026-07-10 09:25:27 +00:00
..