[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}