Closed Bug 2085518 Opened 1 month ago Closed 29 days ago

[wpt-sync] Sync PR 63991 - Don't send a cross-origin relatedTarget on a PointerEvent boundary event, and add more general defense-in-depth for relatedTarget.

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

David Baron <dbaron@chromium.org> wrote:

Don't send a cross-origin relatedTarget on a PointerEvent boundary event, and add more general defense-in-depth for relatedTarget.

This prevents exposing a Node from another origin as the relatedTarget
on pointerout, pointerover, pointerleave, and pointerenter events.

The relatedTarget is instead null, except that when the two documents
have an inner/outer relationship in the frame hierarchy, the events in
the outer document use the frame owner element (e.g., iframe) in that
document that contains the inner document as the relatedTarget.

Same-origin cross-document boundary events retain the existing behavior
of exposing the related target Node across documents, which is tested in
a tentative WPT. It's possible that we should also change this
behavior, though, depending on how other engines behave.

This also includes a second defense-in-depth change to check
relatedTarget for all event types (MouseEvent, PointerEvent, and
FocusEvent) that report it to script (not just this particular
dispatching path) and set it to null if it is a cross-origin node.

Both of these behavior changes are guarded by the
ClearCrossOriginRelatedTarget runtime-enabled feature (status:
stable).

As a followup (to roll out via the normal release branch and not be
merged to older branches) I intend to change the cross-origin check to
be just a cross-document check, which will match the behavior of other
browser engines. This two-stage change will reduce the compatibility
risk of the change that needs merging.

Fixed: 572556403
Bug: 574379564, 574843953
Force-WPT-Export: true
Change-Id: I123aff9643f43fd2de45dae1586f4d2cb2d635a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8611718
Reviewed-by: Mustaq Ahmed \<mustaq@chromium.org>
Commit-Queue: David Baron \<dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1725257}

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

CI Results

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

Total 263 tests and 1 subtests

Status Summary

Firefox

OK : 2[GitHub] 238[Gecko-linux2404-64-debug] 240[Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug] 241[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-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 4[GitHub] 2240[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] 2243[Gecko-windows11-32-25h2-opt] 2244[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL : 4[GitHub] 134[Gecko-windows11-64-25h2-debug] 135[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt] 139[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]
PRECONDITION_FAILED: 84
TIMEOUT : 1[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 3[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]
ERROR : 10
NOTRUN : 11

Chrome

OK : 2
PASS : 4
FAIL : 4

Safari

OK : 2
PASS : 1
FAIL : 7

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d05984397ba5 https://hg.mozilla.org/integration/autoland/rev/581592326ea4 [wpt PR 63991] - Don't send a cross-origin relatedTarget on a PointerEvent boundary event, and add more general defense-in-depth for relatedTarget., a=testonly https://github.com/mozilla-firefox/firefox/commit/0b73c430be56 https://hg.mozilla.org/integration/autoland/rev/2786f3d82b6d [wpt PR 63991] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.