Title: [226244] trunk
Revision
226244
Author
wilan...@apple.com
Date
2017-12-21 14:50:37 -0800 (Thu, 21 Dec 2017)

Log Message

Storage Access API: Allow requests from non-sandboxed iframes
https://bugs.webkit.org/show_bug.cgi?id=181099
<rdar://problem/36184501>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. Changed existing tests.

* dom/Document.cpp:
(WebCore::Document::requestStorageAccess):

LayoutTests:

* http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe-expected.txt:
* http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html:
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-expected.txt:
* http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226243 => 226244)


--- trunk/LayoutTests/ChangeLog	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/LayoutTests/ChangeLog	2017-12-21 22:50:37 UTC (rev 226244)
@@ -1,5 +1,18 @@
 2017-12-21  John Wilander  <wilan...@apple.com>
 
+        Storage Access API: Allow requests from non-sandboxed iframes
+        https://bugs.webkit.org/show_bug.cgi?id=181099
+        <rdar://problem/36184501>
+
+        Reviewed by Brent Fulgham.
+
+        * http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe-expected.txt:
+        * http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html:
+        * http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-expected.txt:
+        * http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html:
+
+2017-12-21  John Wilander  <wilan...@apple.com>
+
         Storage Access API: Make DocumentLoader::willSendRequest() and WebFrameLoaderClient::detachedFromParent2() tell the network process to get rid of any sub frame access entries
         https://bugs.webkit.org/show_bug.cgi?id=180728
         <rdar://problem/36009288>

Modified: trunk/LayoutTests/http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe-expected.txt (226243 => 226244)


--- trunk/LayoutTests/http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe-expected.txt	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/LayoutTests/http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe-expected.txt	2017-12-21 22:50:37 UTC (rev 226244)
@@ -1,4 +1,5 @@
-Tests that cross-origin iframe storage access is denied if the iframe is not sandboxed.
+CONFIRM: Do you want to use your localhost ID on 127.0.0.1?
+Tests that cross-origin iframe storage access is denied if the iframe is not sandboxed and the user declines.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 

Modified: trunk/LayoutTests/http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html (226243 => 226244)


--- trunk/LayoutTests/http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/LayoutTests/http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html	2017-12-21 22:50:37 UTC (rev 226244)
@@ -4,7 +4,7 @@
     <script src=""
     <script src=""
     <script>
-        description("Tests that cross-origin iframe storage access is denied if the iframe is not sandboxed.");
+        description("Tests that cross-origin iframe storage access is denied if the iframe is not sandboxed and the user declines.");
         jsTestIsAsync = true;
 
         const hostUnderTest = "localhost:8000";
@@ -70,6 +70,6 @@
     </script>
 </head>
 <body>
-    <iframe _onload_="runTest()" id="theIframe" src=""
+    <iframe _onload_="runTest()" id="theIframe" src=""
 </body>
 </html>
\ No newline at end of file

Modified: trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-expected.txt (226243 => 226244)


--- trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-expected.txt	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe-expected.txt	2017-12-21 22:50:37 UTC (rev 226244)
@@ -1,9 +1,10 @@
-Tests that cross-origin iframe storage access is denied if the iframe is not sandboxed.
+CONFIRM: Do you want to use your localhost ID on 127.0.0.1?
+Tests that cross-origin iframe storage access is granted if the iframe is not sandboxed and the user accepts.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS Storage access was denied. document.cookie == , cookies seen server-side == "No cookies"
+PASS Storage access was granted. document.cookie == , cookies seen server-side == "No cookies"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html (226243 => 226244)


--- trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/LayoutTests/http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html	2017-12-21 22:50:37 UTC (rev 226244)
@@ -4,7 +4,7 @@
     <script src=""
     <script src=""
     <script>
-        description("Tests that cross-origin iframe storage access is denied if the iframe is not sandboxed.");
+        description("Tests that cross-origin iframe storage access is granted if the iframe is not sandboxed and the user accepts.");
         jsTestIsAsync = true;
 
         const hostUnderTest = "localhost:8000";
@@ -70,6 +70,6 @@
     </script>
 </head>
 <body>
-    <iframe _onload_="runTest()" id="theIframe" src=""
+    <iframe _onload_="runTest()" id="theIframe" src=""
 </body>
 </html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (226243 => 226244)


--- trunk/Source/WebCore/ChangeLog	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/Source/WebCore/ChangeLog	2017-12-21 22:50:37 UTC (rev 226244)
@@ -1,3 +1,16 @@
+2017-12-21  John Wilander  <wilan...@apple.com>
+
+        Storage Access API: Allow requests from non-sandboxed iframes
+        https://bugs.webkit.org/show_bug.cgi?id=181099
+        <rdar://problem/36184501>
+
+        Reviewed by Brent Fulgham.
+
+        No new tests. Changed existing tests.
+
+        * dom/Document.cpp:
+        (WebCore::Document::requestStorageAccess):
+
 2017-12-21  Ryosuke Niwa  <rn...@webkit.org>
 
         Minor cleanup in WebContentReaderCocoa after r226213

Modified: trunk/Source/WebCore/dom/Document.cpp (226243 => 226244)


--- trunk/Source/WebCore/dom/Document.cpp	2017-12-21 22:47:16 UTC (rev 226243)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-12-21 22:50:37 UTC (rev 226244)
@@ -7507,8 +7507,8 @@
         return;
     }
     
-    // There has to be a sandbox and it has to allow the storage access API to be called.
-    if (sandboxFlags() == SandboxNone || isSandboxed(SandboxStorageAccessByUserActivation)) {
+    // If there is a sandbox, it has to allow the storage access API to be called.
+    if (sandboxFlags() != SandboxNone && isSandboxed(SandboxStorageAccessByUserActivation)) {
         promise->reject();
         return;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to