Bug 233182

Summary: CSP: security policy violation event is always using document as target
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cmarcelo, esprehn+autocc, ews-watchlist, kangil.han, katherine_cheney, mkwst, pgriffis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 233037    
Bug Blocks: 233398    
Attachments:
Description Flags
WIP
none
Patch katherine_cheney: review+

Description Carlos Garcia Campos 2021-11-16 03:04:46 PST
We should use the violation element instead if not null. This is causing failures in imported/w3c/web-platform-tests/content-security-policy/securitypolicyviolation/targeting.html but also time outs in other tests connecting the event listener to the target element.
Comment 1 Carlos Garcia Campos 2021-11-16 03:09:00 PST
Created attachment 444366 [details]
WIP

This is WIP for now because it won't apply, it applies on top of patch attached to bug #233037. Once that lands I'll include changelog and new test results.
Comment 2 Carlos Garcia Campos 2021-11-22 02:54:05 PST
Created attachment 444954 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2021-11-23 03:05:19 PST
<rdar://problem/85697149>
Comment 4 Kate Cheney 2021-11-23 08:11:55 PST
Comment on attachment 444954 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444954&action=review

> Source/WebCore/ChangeLog:15
> +        (WebCore::Element::enqueueSecurityPolicyViolationEvent): Helper to queue ecuritypolicyviolationEvent for element.

nit: ecuritypolicyviolationEvent > securitypolicyviolationEvent
Comment 5 Carlos Garcia Campos 2021-11-23 08:24:39 PST
Committed r286136 (244523@main): <https://commits.webkit.org/244523@main>