github web-platform-tests/wpt merge_pr_49032

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
one month ago

[Selection] Fix select text within shadow DOM with delegatesFocus

This patch makes it possible to select text in shadowDOM with
delegatesFocus set.

In MouseEventManager::HandleMouseFocus, when the focus is slided to the
shadow host's delegated target, the event is marked as not
handled so we can reach the selection controller:

EventHandler::HandleMousePressEvent
-> MouseEventManager::HandleMouseFocus, not handled
-> MouseEventManager::HandleMousePressEvent
--> GetSelectionController().HandleMousePressEvent()

In SelectionFrame::SelectionHasFocus, we update to return true if
selection is in shadow host with delegatesFocus and the focused element
is that shadow host's focusable area.

Further, we add more test cases and put the change behind the flag
SelectionOnShadowDOMWithDelegatesFocus.

Change-Id: I69ccb4b46d4d399cad7a94d2a54524612ad12f4e
Bug: 40622041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5996772
Reviewed-by: Joey Arhar jarhar@chromium.org
Commit-Queue: Di Zhang dizhangg@chromium.org
Reviewed-by: Siye Liu siliu@microsoft.com
Cr-Commit-Position: refs/heads/main@{#1379892}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.