Closed Bug 1955696 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 51524 - [Selection] delegated target text control are mouse event handled

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Di Zhang <dizhangg@chromium.org> wrote:

[Selection] delegated target text control are mouse event handled

We add the feature DelegatesFocusTextControlFix,
which fixes this case: when the mouse target element is a shadow host
with delegatesFocus, but its focusable area is a text control element.

Currently, this text control element will be marked as focused and not
handled. The selection will be set on where the click happened.
That is wrong because, in this case, focus and selection should both be
on the text control.
We fix this by updating the logic in MouseEventManager::HandleMouseFocus

  1. If focusable area is already focused, no need to re-focus and return
    not handled so selection can be set where click happened.
  2. Else, if focusable area is a text control, focus it and return
    handled so selection stays on it.
  3. Else, focus it and return not handled so selection can be set where
    click happened.

Change-Id: I553aec3d49c6984194ae8eefe2ac95673429d8c7
Bug: 400317114
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6324829
Reviewed-by: Mason Freed \<masonf@chromium.org>
Commit-Queue: Di Zhang \<dizhangg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1436159}

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 0 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
FAIL: 1

Links

GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5db25d6fe7eb [wpt PR 51524] - [Selection] delegated target text control are mouse event handled, a=testonly
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.