Closed Bug 2086498 Opened 1 month ago Closed 18 days ago

[wpt-sync] Sync PR 64252 - Omit unknown source code location in inspector CSP issue

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Byungwoo Lee <blee@igalia.com> wrote:

Omit unknown source code location in inspector CSP issue

When GatherSecurityPolicyViolationEventData() collects the CSP
violation event data into SecurityPolicyViolationEventInit, it
treats the received source location as unknown if its line number
is zero, so ContentSecurityPolicy::ReportViolation dispatches and
reports the violation without a source location.

But GatherSecurityPolicyViolationEventData() returned the source
location as is, so the inspector CSP issue got a source code location
with a non-empty URL and an unknown line number (-1 in the protocol)
for the violation (e.g. a CSS background image fetched by style
recalculation after the document is parsed).

Return null when GatherSecurityPolicyViolationEventData() receives an
unknown source location, so that the inspector CSP issue omits the
sourceCodeLocation field for the violation.

Bug: 577884869
Change-Id: I367817ded6f794c16d77b1e449bd7d61e355e5da
Reviewed-on: https://chromium-review.googlesource.com/8657479
WPT-Export-Revision: d50d393cf6439c4a3d5f47dd89718e20b82d5969

Component: web-platform-tests → DOM: Security
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 15 tests and 2 subtests

Status Summary

Firefox

OK : 1[GitHub] 15[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: 35
FAIL: 1[GitHub] 6[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]

Chrome

OK : 1
PASS: 1

Safari

OK : 1
PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

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