Storage Access API: Maintain access through same-site navigations
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2018 21:09:36 +0000 (21:09 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2018 21:09:36 +0000 (21:09 +0000)
commit0ba6eeb59aec7611cdd8a8e9c8e09e3c159dd042
treecb35a57668a1f4ca0ecb3e059bc022e3260e6825
parent4b53c1e4d2ab860fd3a981b3c854f84eca25915c
Storage Access API: Maintain access through same-site navigations
https://bugs.webkit.org/show_bug.cgi?id=188564
<rdar://problem/43445160>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
       http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html

* dom/Document.h:
    Removed unused member variable m_hasFrameSpecificStorageAccess.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* loader/FrameLoaderClient.h:

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
    Now takes the current URL and the new URL as parameters
    and only clears out storage access if the navigation is
    cross-site, i.e. with differing eTLD+1s.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:

* http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame-expected.txt:
* http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html:
    Added both a same-site and a cross-site navigation to the sub frame to test maintained and cleared access.
* http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access-expected.txt: Copied from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt.
* http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html: Copied from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html.
* http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access-expected.txt: Renamed from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt.
* http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html: Renamed from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html.
* http/tests/storageAccess/resources/get-cookies.php:
    Support for the new test scenarios.
* http/tests/storageAccess/resources/self-navigating-frame-after-granted-access.html:
    Support for the new test scenarios.
* platform/mac-wk2/TestExpectations:
    Marked the new and the renamed tests as [ Pass ].

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame-expected.txt
LayoutTests/http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access-expected.txt [moved from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt with 82% similarity]
LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html [moved from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html with 96% similarity]
LayoutTests/http/tests/storageAccess/resources/get-cookies.php
LayoutTests/http/tests/storageAccess/resources/self-navigating-frame-after-granted-access.html
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.h
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/FrameLoaderClient.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h