Bug 216019

Summary: Storage Access API: Allow requests for storage access from nested iframes
Product: WebKit Reporter: John Wilander <wilander>
Component: WebCore Misc.Assignee: John Wilander <wilander>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, brad.girardeau, cdumez, esprehn+autocc, ews-watchlist, kangil.han, katherine_cheney, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description John Wilander 2020-08-31 17:45:21 PDT
It was decided browsers should support requests for storage access from nested iframes as part of the standardization of the Storage Access API. The issue is discussed here: https://github.com/privacycg/storage-access/issues/10
Comment 1 Radar WebKit Bug Importer 2020-08-31 17:45:49 PDT
<rdar://problem/68109918>
Comment 2 John Wilander 2020-08-31 17:51:58 PDT
Created attachment 407641 [details]
Patch
Comment 3 John Wilander 2020-09-01 08:29:53 PDT
The mac-debug-wk1 bot seems to be in bad shape, exiting testing early.
Comment 4 Kate Cheney 2020-09-01 09:12:26 PDT
Comment on attachment 407641 [details]
Patch

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

LGTM, it is one of those patches where the testing is far more complicated than the change!

> LayoutTests/http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe-database.html:42
> +            testRunner.setStatisticsShouldBlockThirdPartyCookies(false, function() {

I believe this is set to false in WKWebsiteDataStoreStatisticsResetToConsistentState(), which is called between every test, so it should not be needed here.

> LayoutTests/http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html:42
> +            testRunner.setStatisticsShouldBlockThirdPartyCookies(false, function() {

Ditto, this can just be setEnableFeature(false, finishJSTest);
Comment 5 John Wilander 2020-09-01 11:33:04 PDT
(In reply to katherine_cheney from comment #4)
> Comment on attachment 407641 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=407641&action=review
> 
> LGTM, it is one of those patches where the testing is far more complicated
> than the change!

So true! But satisfying to make the change and immediately getting a failed test case.

> > LayoutTests/http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe-database.html:42
> > +            testRunner.setStatisticsShouldBlockThirdPartyCookies(false, function() {
> 
> I believe this is set to false in
> WKWebsiteDataStoreStatisticsResetToConsistentState(), which is called
> between every test, so it should not be needed here.

Oh, I'll confirm and fix.

> > LayoutTests/http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html:42
> > +            testRunner.setStatisticsShouldBlockThirdPartyCookies(false, function() {
> 
> Ditto, this can just be setEnableFeature(false, finishJSTest);

Ditto.

Thanks, Kate!
Comment 6 John Wilander 2020-09-01 13:14:01 PDT
Created attachment 407708 [details]
Patch
Comment 7 John Wilander 2020-09-02 11:46:34 PDT
Comment on attachment 407708 [details]
Patch

Thanks, Alex!
Comment 8 EWS 2020-09-02 12:19:58 PDT
Committed r266479: <https://trac.webkit.org/changeset/266479>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407708 [details].
Comment 9 John Wilander 2020-09-02 13:00:08 PDT
*** Bug 205370 has been marked as a duplicate of this bug. ***