Closed Bug 1969002 Opened 11 months ago Closed 11 months ago

[wpt-sync] Sync PR 52829 - Improve Event.source retargeting

Categories

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

task

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(2 files)

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

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

Joey Arhar <jarhar@chromium.org> wrote:

Improve Event.source retargeting

Before this patch, the source attribute of ToggleEvent and CommandEvent
can be leaked from inside a ShadowRoot by looking at the attribute after
event dispatch.

This patch fixes this by retargeting the source attribute against the
event's target, which is already set up to avoid leakage.

Side note: This is similar to relatedTarget, but relatedTarget is
extremely complicated and it makes me wonder why we can't remove all
that code and make relatedTarget work like source.

Bug: 420639769
Change-Id: I2d16741e703b109677af2cb0d882d391d63caccc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6526266
Commit-Queue: Joey Arhar \<jarhar@chromium.org>
Reviewed-by: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1466495}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 9 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
FAIL: 3

Chrome

OK : 1
PASS: 1
FAIL: 2

Safari

OK : 1
FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Automatic update from web-platform-tests
Improve Event.source retargeting

Before this patch, the source attribute of ToggleEvent and CommandEvent
can be leaked from inside a ShadowRoot by looking at the attribute after
event dispatch.

This patch fixes this by retargeting the source attribute against the
event's target, which is already set up to avoid leakage.

Side note: This is similar to relatedTarget, but relatedTarget is
extremely complicated and it makes me wonder why we can't remove all
that code and make relatedTarget work like source.

Bug: 420639769
Change-Id: I2d16741e703b109677af2cb0d882d391d63caccc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6526266
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1466495}

--

wpt-commits: 8c574723e8eca556df3567f2a47b2dff6df9504c
wpt-pr: 52829

Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Blocks: 1983253
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: