Bug 245757

Summary: Add proper support for "Parsing Structured Fields" from RFC8941
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: annevk, marcosc, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://datatracker.ietf.org/doc/html/rfc8941#section-4.2
Bug Depends on: 245750    
Bug Blocks: 241952    

Description Chris Dumez 2022-09-27 15:58:36 PDT
Add proper support for "Parsing Structured Fields" from RFC8941 for both "item" and "dictionary" types. The spec also supports the "list" type, but I didn't add it yet since we don't have any users yet.

The "item" type is used to parse the Cross-Origin-Opener-Policy & Cross-Origin-Embedder-Policy headers:
- https://html.spec.whatwg.org/multipage/origin.html#obtain-coop (step 3)
- https://html.spec.whatwg.org/multipage/origin.html#obtain-an-embedder-policy (step 3)

The "dictionary" type is used to parse the Reporting-Endpoints header:
- https://w3c.github.io/reporting/#process-header (step 2)

We had partial support in 2 different places with no code sharing. We know have near complete support with code sharing.

This will allow us to implement support for the Permission-Policy header more easily in the near future:
- https://www.w3.org/TR/permissions-policy-1/#algo-process-response-policy (step 1)
Comment 1 Chris Dumez 2022-09-27 16:27:12 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4775
Comment 2 EWS 2022-09-28 18:11:26 PDT
Committed 254983@main (96319c7e58ba): <https://commits.webkit.org/254983@main>

Reviewed commits have been landed. Closing PR #4775 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-09-28 18:12:42 PDT
<rdar://problem/100537297>