[wpt-sync] Sync PR 63450 - [focus-without-user-activation] Fix label forwarding
Categories
(Core :: DOM: Security, task, P4)
Tracking
()
| 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/12032Bug: 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}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=102982
| Assignee | ||
Comment 2•1 month ago
|
||
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
- /permissions-policy/experimental-features/vertical-scroll-disabled-scrollbar-tentative.html [wpt.fyi]:
FAIL - /permissions-policy/experimental-features/unload-disallowed-embed.tentative.window.html [wpt.fyi]:
SKIP - /permissions-policy/experimental-features/unload-disallowed-object.tentative.window.html [wpt.fyi]:
SKIP - /permissions-policy/experimental-features/focus-without-user-activation-click-handler.tentative.html [wpt.fyi]
- A denied window can trigger focus through an allowed window's own click handler:
FAIL - A click handler defined in a denied window cannot borrow the button owner's focus permission:
FAIL
- A denied window can trigger focus through an allowed window's own click handler:
- /permissions-policy/experimental-features/focus-without-user-activation-default-permissions-policy.https.sub.html [wpt.fyi]
- Default "focus-without-user-activation" permissions policy [*] allows same-origin iframes.:
FAIL - Default "focus-without-user-activation" permissions policy [*] allows cross-origin iframes.:
FAIL
- Default "focus-without-user-activation" permissions policy [*] allows same-origin iframes.:
- /permissions-policy/experimental-features/focus-without-user-activation-disabled.html [wpt.fyi]
- When the policy is disabled, 'autofocus' and scripted focus do not focus the document.:
FAIL
- When the policy is disabled, 'autofocus' and scripted focus do not focus the document.:
- /permissions-policy/experimental-features/focus-without-user-activation-enabled.sub.html [wpt.fyi]
- When the policy is enabled, 'autofocus' and scripted focus do focus the document.:
FAIL
- When the policy is enabled, 'autofocus' and scripted focus do focus the document.:
- /permissions-policy/experimental-features/focus-without-user-activation-focused-frame-descendant-cross-origin.https.sub.html [wpt.fyi]
- Cross-origin iframe with policy denied cannot steal focus from parent or sibling:
FAIL
- Cross-origin iframe with policy denied cannot steal focus from parent or sibling:
- /permissions-policy/experimental-features/focus-without-user-activation-focused-frame-descendant.html [wpt.fyi]
- Iframe with policy denied and without focus cannot steal focus from parent frame:
FAIL - Sibling iframe with policy denied cannot steal focus from focused sibling:
FAIL - Nested child iframe with policy denied cannot steal focus from parent iframe that has focus:
FAIL
- Iframe with policy denied and without focus cannot steal focus from parent frame:
- /permissions-policy/experimental-features/focus-without-user-activation-label-click.tentative.html [wpt.fyi]
- click on a label checks the caller's focus permission:
FAIL(Chrome:FAIL, Safari:FAIL) - dispatchEvent on a label checks the caller's focus permission:
FAIL(Chrome:FAIL, Safari:FAIL)
- click on a label checks the caller's focus permission:
- /permissions-policy/experimental-features/focus-without-user-activation-setter-policy.html [wpt.fyi]
- Setter with policy denied cannot focus element in parent with policy allowed:
FAIL
- Setter with policy denied cannot focus element in parent with policy allowed:
- /permissions-policy/experimental-features/focus-without-user-activation-target-frame-state-ignored.html [wpt.fyi]
- Target iframe activation does not authorize a focus call from a restricted initiator:
FAIL
- Target iframe activation does not authorize a focus call from a restricted initiator:
- /permissions-policy/experimental-features/permissions-policy-header-host-wildcard.https.sub.html [wpt.fyi]
- Test wildcard host policy works as expected:
FAIL
- Test wildcard host policy works as expected:
- /permissions-policy/experimental-features/permissions-policy-header-port-wildcard.https.sub.html [wpt.fyi]
- Test wildcard port policy works as expected:
FAIL
- Test wildcard port policy works as expected:
- /permissions-policy/experimental-features/permissions-policy-header-scheme-only.https.sub.html [wpt.fyi]
- Test scheme only policy works as expected:
FAIL
- Test scheme only policy works as expected:
- /permissions-policy/experimental-features/private-state-token-redemption-default-permissions-policy.tentative.https.sub.html [wpt.fyi]
- Default "private-state-token-redemption" permissions policy ["self"] allows the top-level document.:
FAIL - Default "private-state-token-redemption" permissions policy ["self"] allows same-origin iframes.:
FAIL - Default "private-state-token-redemption" permissions policy ["self"] allows cross-origin iframes.:
FAIL - Default "private-state-token-redemption" permissions policy ["self"] and allow="private-state-token-redemption 'none'" disallows cross-origin iframes.:
FAIL
- Default "private-state-token-redemption" permissions policy ["self"] allows the top-level document.:
- /permissions-policy/experimental-features/private-state-token-redemption-supported-by-permissions-policy.tentative.html [wpt.fyi]
- document.permissionsPolicy.features should advertise private-state-token-redemption.:
FAIL
- document.permissionsPolicy.features should advertise private-state-token-redemption.:
- /permissions-policy/experimental-features/unload-allowed-by-default.tentative.window.html [wpt.fyi]
- 'unload' Policy : allowed by default:
FAIL
- 'unload' Policy : allowed by default:
- /permissions-policy/experimental-features/unload-allowed-embed.tentative.window.html [wpt.fyi]
- 'unload' Policy : allowed in frames when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in frames when allowed in main frame.:
- /permissions-policy/experimental-features/unload-allowed-frameset.tentative.window.html [wpt.fyi]
- 'unload' Policy : allowed in frames when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in frames when allowed in main frame.:
- /permissions-policy/experimental-features/unload-allowed-headerless.tentative.window.html?urlType=srcdoc [wpt.fyi]
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
- /permissions-policy/experimental-features/unload-allowed-headerless.tentative.window.html?urlType=data [wpt.fyi]
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
- /permissions-policy/experimental-features/unload-allowed-headerless.tentative.window.html?urlType=blank [wpt.fyi]
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
- /permissions-policy/experimental-features/unload-allowed-headerless.tentative.window.html?urlType=blob [wpt.fyi]
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in headerless doc when allowed in main frame.:
- /permissions-policy/experimental-features/unload-allowed-object.tentative.window.html [wpt.fyi]
- 'unload' Policy : allowed in frames when allowed in main frame.:
FAIL
- 'unload' Policy : allowed in frames when allowed in main frame.:
- /permissions-policy/experimental-features/unload-disallowed-frameset.tentative.window.html [wpt.fyi]
- 'unload' Policy : disallowed in frames when disallowed in main frame.:
FAIL
- 'unload' Policy : disallowed in frames when disallowed in main frame.:
- /permissions-policy/experimental-features/unload-disallowed-headerless.tentative.window.html?urlType=data [wpt.fyi]
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
FAIL
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
- /permissions-policy/experimental-features/unload-disallowed-headerless.tentative.window.html?urlType=blob [wpt.fyi]
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
FAIL
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
- /permissions-policy/experimental-features/unload-disallowed-headerless.tentative.window.html?urlType=blank [wpt.fyi]
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
FAIL
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
- /permissions-policy/experimental-features/unload-disallowed-headerless.tentative.window.html?urlType=srcdoc [wpt.fyi]
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
FAIL
- 'unload' Policy : disallowed in headerless doc when disallowed in main frame.:
- /permissions-policy/experimental-features/unload-disallowed-subframe.tentative.window.html [wpt.fyi]
- 'unload' Policy : allowed in main frame but disallowed in subframe:
FAIL
- 'unload' Policy : allowed in main frame but disallowed in subframe:
- /permissions-policy/experimental-features/unload-disallowed.tentative.window.html [wpt.fyi]
- 'unload' Policy : disallowed when header is ():
FAIL
- 'unload' Policy : disallowed when header is ():
- /permissions-policy/experimental-features/vertical-scroll-scrollintoview.tentative.html [wpt.fyi]
- Calling 'scrollIntoView()' inside a <iframe> with 'vertical-scroll none;'will not propagate upwards.:
FAIL
- Calling 'scrollIntoView()' inside a <iframe> with 'vertical-scroll none;'will not propagate upwards.:
Tests Disabled in Gecko Infrastructure
https://hg.mozilla.org/mozilla-central/rev/2a4c5992764b
https://hg.mozilla.org/mozilla-central/rev/919db18aebc6
Description
•