Closed Bug 1931968 Opened 23 days ago Closed 14 days ago

[wpt-sync] Sync PR 49236 - [focus] Make mouse focus use flat tree parent

Categories

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

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Di Zhang <dizhangg@chromium.org> wrote:

[focus] Make mouse focus use flat tree parent

This is an updated version of patch:
https://crrev.com/c/1514433

Currently, mouse-triggered event will traverse up parentOrShadowHost
to find fallback element to receive mouse focus. This doesn't make sense
for slotted content, where we expect the parent to receive focus to be
the assigned slot. This is fixed by traversing using the Flat Tree.

In the DOM spec for the Dispatch algorithm [1]:

"If isActivationEvent is true, event’s bubbles attribute is true,
activationTarget is null, and parent has activation behavior, then set
activationTarget to parent."

The parent is found using the get the parent algorithm [2]:
"A node’s get the parent algorithm, given an event, returns the node’s
assigned slot, if node is assigned; otherwise node’s parent."

Previously, this patch was reverted because it broke the text selection
in DevTools Network panel, which uses slots. This is fixed by
updating FrameSelection to use flat tree traversal to find parent.

The change is behind flag MouseFocusFlatTreeParent.

[1] https://dom.spec.whatwg.org/#concept-event-dispatch
[2] https://dom.spec.whatwg.org/#get-the-parent

Change-Id: Ibfeaebab0dce4817c34b447f540e784b12b9ab56
Bug: 41420461
Reviewed-on: https://chromium-review.googlesource.com/6004068
WPT-Export-Revision: 9637638e5a2d162e59bfe5904fbfc8b9ff114a41

Component: web-platform-tests → DOM: Core & HTML
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 3 subtests

Status Summary

Firefox

OK : 1
PASS: 2
FAIL: 1

Chrome

OK : 1
PASS: 1
FAIL: 2

Safari

OK : 1
PASS: 3

Links

GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ebf7d0374aa2 [wpt PR 49236] - [focus] Make mouse focus use flat tree parent, a=testonly https://hg.mozilla.org/integration/autoland/rev/eacb3e62688f [wpt PR 49236] - Update wpt metadata, a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/34e3a5189d08 [wpt PR 49236] - [focus] Make mouse focus use flat tree parent, a=testonly https://hg.mozilla.org/integration/autoland/rev/cdf9751a6288 [wpt PR 49236] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 14 days ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.