Closed Bug 1929930 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 49032 - [Selection] Fix select text within shadow DOM with delegatesFocus

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 49032 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/49032
Details from upstream follow.

Di Zhang <dizhangg@chromium.org> wrote:

[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/5996772
WPT-Export-Revision: ec440512e81378110be617648ed49568ca912cc7

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 1 subtests

Status Summary

Firefox

OK : 1
PASS: 1

Chrome

OK : 1
FAIL: 1

Safari

OK : 1
PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2214ffa092c1 [wpt PR 49032] - [Selection] Fix select text within shadow DOM with delegatesFocus, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.