Bug 229041 - Add Cross-Origin-Embedder-Policy support for Blob URLs
Summary: Add Cross-Origin-Embedder-Policy support for Blob URLs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://github.com/whatwg/html/issues...
Keywords: InRadar
Depends on:
Blocks: 228755
  Show dependency treegraph
 
Reported: 2021-08-12 09:25 PDT by Chris Dumez
Modified: 2021-08-13 19:29 PDT (History)
22 users (show)

See Also:


Attachments
WIP patch (38.56 KB, patch)
2021-08-12 09:52 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (52.11 KB, patch)
2021-08-13 15:19 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (62.19 KB, patch)
2021-08-13 17:17 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (62.54 KB, patch)
2021-08-13 17:51 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-08-12 09:25:11 PDT
Add Cross-Origin-Embedder-Policy support for Blob URLs.
Comment 1 Chris Dumez 2021-08-12 09:52:25 PDT
Created attachment 435430 [details]
WIP patch
Comment 2 Chris Dumez 2021-08-12 10:07:14 PDT
imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html is completely failing still, even though html/cross-origin-opener-policy/coep-blob-popup.https.html is fully passing :/ Investigating...
Comment 3 Chris Dumez 2021-08-13 15:19:06 PDT
Created attachment 435521 [details]
Patch
Comment 4 Alex Christensen 2021-08-13 16:28:23 PDT
Comment on attachment 435521 [details]
Patch

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

> Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp:84
> +    void registerBlobURL(const URL& url, const URL& srcURL, const CrossOriginOpenerPolicy& coop, const CrossOriginEmbedderPolicy& coep) final { m_blobRegistry.registerBlobURL(url, srcURL, coop, coep); }

Should we make a struct that contains both and call it CrossOriginPolicies?

> LayoutTests/platform/mac-wk1/TestExpectations:376
> +imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Skip ]

Why not skip the whole directory?

> LayoutTests/platform/win/TestExpectations:3728
> +imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Skip ]

ditto
Comment 5 Chris Dumez 2021-08-13 16:30:02 PDT
(In reply to Alex Christensen from comment #4)
> Comment on attachment 435521 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=435521&action=review
> 
> > Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp:84
> > +    void registerBlobURL(const URL& url, const URL& srcURL, const CrossOriginOpenerPolicy& coop, const CrossOriginEmbedderPolicy& coep) final { m_blobRegistry.registerBlobURL(url, srcURL, coop, coep); }
> 
> Should we make a struct that contains both and call it CrossOriginPolicies?

Sure, why not.

> 
> > LayoutTests/platform/mac-wk1/TestExpectations:376
> > +imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Skip ]
> 
> Why not skip the whole directory?
> 
> > LayoutTests/platform/win/TestExpectations:3728
> > +imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Skip ]
> 
> ditto

I guess we could. I don't really care about COOP for WK1. That said, COOP is implemented and working in WebKit1. The only reason this test fails on WK1 is because the test relies on COEP in addition to COOP (and COEP is unimplemented in WK1).
Comment 6 Chris Dumez 2021-08-13 17:17:04 PDT
Created attachment 435529 [details]
Patch
Comment 7 Darin Adler 2021-08-13 17:21:42 PDT
Comment on attachment 435529 [details]
Patch

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

> Source/WebCore/dom/SecurityContext.h:30
> +#include "PolicyContainer.h"

Typically we don’t need to include a header just to declare a function with that type as a return value. It can be a forward declaration.
Comment 8 Chris Dumez 2021-08-13 17:51:38 PDT
Created attachment 435530 [details]
Patch
Comment 9 EWS 2021-08-13 19:28:27 PDT
Committed r281055 (240518@main): <https://commits.webkit.org/240518@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435530 [details].
Comment 10 Radar WebKit Bug Importer 2021-08-13 19:29:16 PDT
<rdar://problem/81925692>