[wpt-sync] Sync PR 49236 - [focus] Make mouse focus use flat tree parent
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
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/1514433Currently, 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-parentChange-Id: Ibfeaebab0dce4817c34b447f540e784b12b9ab56
Bug: 41420461
Reviewed-on: https://chromium-review.googlesource.com/6004068
WPT-Export-Revision: 9637638e5a2d162e59bfe5904fbfc8b9ff114a41
Assignee | ||
Updated•23 days ago
|
Assignee | ||
Comment 1•23 days ago
|
||
Assignee | ||
Comment 2•23 days ago
|
||
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
Details
Firefox-only Failures
- /shadow-dom/focus/click-focus-slot-ancestor.html [wpt.fyi]
- Select on non-focusable non-editable slot in a contenteditable shadow DOM and inside focusable div will select text:
FAIL
- Select on non-focusable non-editable slot in a contenteditable shadow DOM and inside focusable div will select text:
New Tests That Don't Pass
- /shadow-dom/focus/click-focus-slot-ancestor.html [wpt.fyi]
- Select on non-focusable non-editable slot in a contenteditable shadow DOM and inside focusable div will select text:
FAIL
(Chrome:PASS
, Safari:PASS
)
- Select on non-focusable non-editable slot in a contenteditable shadow DOM and inside focusable div will select text:
Comment 5•14 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/34e3a5189d08
https://hg.mozilla.org/mozilla-central/rev/cdf9751a6288
Description
•