Page MenuHomePhabricator

Bug 1909705 - Fix WPT to adhere to spec. r=#dom-core!
ClosedPublic

Authored by sfarre on Jan 13 2026, 5:41 PM.
Referenced Files
Unknown Object (File)
Tue, Apr 14, 10:00 AM
Unknown Object (File)
Mon, Apr 13, 10:30 PM
Unknown Object (File)
Sun, Apr 5, 3:07 PM
Unknown Object (File)
Sat, Apr 4, 1:19 PM
Unknown Object (File)
Sat, Apr 4, 12:50 PM
Unknown Object (File)
Sat, Apr 4, 12:03 PM
Unknown Object (File)
Sat, Apr 4, 9:08 AM
Unknown Object (File)
Sat, Apr 4, 1:53 AM
Subscribers

Details

Summary

Make reporting of sourceFile, lineNumber, column more consistent

Changes the test so that it checks for nulls.

Added test (#2) that has script running and therefore should have source
information.

/content-security-policy/reporting-api/report-to-directive-allowed-in-meta.https.sub.html
also had the same problem, of expecting source code information with no
running javascript. Checks for null instead.

See https://w3c.github.io/webappsec-csp/#create-violation-for-global

Diff Detail

Event Timeline

sfarre created this revision.
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".Jan 13 2026, 5:41 PM
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
sfarre updated this revision to Diff 1183761.
sfarre retitled this revision from WIP: Bug 1909705 - Fix WPT to adhere to spec. to Bug 1909705 - Fix WPT to adhere to spec. r=#dom-core!.
sfarre added a reviewer: dom-core.
smaug requested changes to this revision.Jan 13 2026, 6:24 PM
smaug added a subscriber: smaug.
smaug added inline comments.
testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation.https.sub.html
41

lineNumber nor columnNumber values aren't defined anywhere, so they could be anything.
I think we need to allow different values here.

This revision now requires changes to proceed.Jan 13 2026, 6:24 PM
sfarre updated this revision to Diff 1184384.
sfarre added inline comments.
testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation.https.sub.html
41

Right. Created a new file to test for source information and I use e.g. [53, 54] and checks that the value is one of them, to test for 0 or 1 based numbering.

smaug added a project: testing-approved.
smaug added inline comments.
testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation-2.https.sub.html
40

And these pass in Chrome too?

testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation.https.sub.html
41

Could you add a comment why these are null, or perhaps a spec link or something.

This revision is now accepted and ready to land.Jan 14 2026, 2:29 PM
sfarre marked 3 inline comments as done.
testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation-2.https.sub.html
40

Hmm this seems to not pass on chrome, I was almost certain it passed with this change.

testing/web-platform/tests/content-security-policy/reporting-api/reporting-api-sends-reports-on-violation-2.https.sub.html
40

Now both tests confusingly does not pass on chrome. This one, where we expect to have a sourceFile, because we actually have JS running when the CSP violation happens, (line 54, theImage.src = foo), chrome reports null, but the other test, when we don't have js running, it reports the source file (and invalid src and line numbers).

sfarre edited the summary of this revision. (Show Details)
sfarre edited the summary of this revision. (Show Details)