Closed Bug 2080212 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63450 - [focus-without-user-activation] Fix label forwarding

Categories

(Core :: DOM: Security, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Fernando Fiori <ffiori@microsoft.com> wrote:

[focus-without-user-activation] Fix label forwarding

Preserve the calling frame when a label forwards focus to its associated
control, both for label.focus() and scripted click activation. Losing
the caller caused these paths to check the target document's permissions
policy instead.

Forward FocusParams::initiator_frame from HTMLLabelElement::Focus(). For
untrusted click events, use the incumbent window's frame as the
initiator, matching Element::focusForBindings(). Trusted clicks (user
input, accessibility, UA-simulated) still use the label's frame.

The new WPT is tentative while initiator attribution is specified:
https://github.com/whatwg/html/issues/12032

Bug: 523708065
Change-Id: I2e4ac1ba4a6b836594512105e21ed03e5668a528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8464353
Reviewed-by: Jacques Newman \<janewman@microsoft.com>
Reviewed-by: Dan Clark \<daniec@microsoft.com>
Commit-Queue: Fernando Fiori \<ffiori@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1715143}

Component: web-platform-tests → DOM: Security
Product: Testing → Core

CI Results

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

Total 36 tests and 2 subtests

Status Summary

Firefox

OK : 1[GitHub] 33[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 11
FAIL: 2[GitHub] 38[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 39[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
FAIL: 2

Safari

OK : 1
FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.