Storage Access API: Make document.hasStorageAccess a function and always allow access...
authorsaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 19:56:13 +0000 (19:56 +0000)
committersaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 19:56:13 +0000 (19:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176944
<rdar://problem/34440658>

Patch by John Wilander <wilander@apple.com> on 2017-12-06
Reviewed by Brent Fulgham.

Test: http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-user-gesture.html

This change introduces document.hasStorageAccess() as a function which
returns a promise instead of being a property. Since cookie access can
be due to both a granted request and recent user interaction as first
party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.

* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
    Removed check of the previous m_hasStorageAccess member.
    Same-origin check done earlier. This was a request/suggestion
    from Mozilla.
* dom/Document.h:
(WebCore::Document::hasStorageAccess const): Deleted.
    Now uses a promise.
* dom/Document.idl:
* page/ChromeClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog

index cde2251..0a44da7 100644 (file)
@@ -86,6 +86,8 @@
 
         Disable using CGContextDrawPathDirect() for macOS High Sierra or earlier.
         This API has a bug when drawing a path with a shadow on Retina display.
+        This bug is tracked internally by <rdar://problem/35620690>.
+
 
         * platform/graphics/cg/GraphicsContextCG.cpp: