Title: [291017] trunk
Revision
291017
Author
[email protected]
Date
2022-03-08 15:27:30 -0800 (Tue, 08 Mar 2022)

Log Message

Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
https://bugs.webkit.org/show_bug.cgi?id=237605

Reviewed by Darin Adler.

Source/WebCore:

Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
- https://github.com/whatwg/html/pull/7654#issuecomment-1054219407

There is no backward compatibility risk since support for this flag was added very recently
in r290958.

* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:

Source/WebKit:

Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
- https://github.com/whatwg/html/pull/7654#issuecomment-1054219407

There is no backward compatibility risk since support for this flag was added very recently
in r290958.

* UIProcess/WebPageProxy.cpp:
(WebKit::frameSandboxAllowsOpeningExternalCustomProtocols):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291016 => 291017)


--- trunk/Source/WebCore/ChangeLog	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebCore/ChangeLog	2022-03-08 23:27:30 UTC (rev 291017)
@@ -1,3 +1,21 @@
+2022-03-08  Chris Dumez  <[email protected]>
+
+        Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
+        https://bugs.webkit.org/show_bug.cgi?id=237605
+
+        Reviewed by Darin Adler.
+
+        Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
+        - https://github.com/whatwg/html/pull/7654#issuecomment-1054219407
+
+        There is no backward compatibility risk since support for this flag was added very recently
+        in r290958.
+
+        * dom/SecurityContext.cpp:
+        (WebCore::SecurityContext::isSupportedSandboxPolicy):
+        (WebCore::SecurityContext::parseSandboxPolicy):
+        * dom/SecurityContext.h:
+
 2022-03-08  Alex Christensen  <[email protected]>
 
         Fix Windows debug build

Modified: trunk/Source/WebCore/dom/SecurityContext.cpp (291016 => 291017)


--- trunk/Source/WebCore/dom/SecurityContext.cpp	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebCore/dom/SecurityContext.cpp	2022-03-08 23:27:30 UTC (rev 291017)
@@ -84,7 +84,7 @@
 bool SecurityContext::isSupportedSandboxPolicy(StringView policy)
 {
     static const char* const supportedPolicies[] = {
-        "allow-custom-protocols-navigation", "allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups", "allow-popups-to-escape-sandbox", "allow-top-navigation-by-user-activation", "allow-modals", "allow-storage-access-by-user-activation"
+        "allow-top-navigation-to-custom-protocols", "allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups", "allow-popups-to-escape-sandbox", "allow-top-navigation-by-user-activation", "allow-modals", "allow-storage-access-by-user-activation"
     };
 
     for (auto* supportedPolicy : supportedPolicies) {
@@ -133,8 +133,8 @@
             flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts;
         else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-top-navigation-by-user-activation"))
             flags &= ~SandboxTopNavigationByUserActivation;
-        else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-custom-protocols-navigation"))
-            flags &= ~SandboxCustomProtocolsNavigation;
+        else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-top-navigation-to-custom-protocols"))
+            flags &= ~SandboxTopNavigationToCustomProtocols;
         else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-modals"))
             flags &= ~SandboxModals;
         else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-storage-access-by-user-activation"))

Modified: trunk/Source/WebCore/dom/SecurityContext.h (291016 => 291017)


--- trunk/Source/WebCore/dom/SecurityContext.h	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebCore/dom/SecurityContext.h	2022-03-08 23:27:30 UTC (rev 291017)
@@ -58,7 +58,7 @@
     SandboxDocumentDomain       = 1 << 11,
     SandboxModals               = 1 << 12,
     SandboxStorageAccessByUserActivation = 1 << 13,
-    SandboxCustomProtocolsNavigation = 1 << 14,
+    SandboxTopNavigationToCustomProtocols = 1 << 14,
     SandboxAll                  = -1 // Mask with all bits set to 1.
 };
 

Modified: trunk/Source/WebKit/ChangeLog (291016 => 291017)


--- trunk/Source/WebKit/ChangeLog	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebKit/ChangeLog	2022-03-08 23:27:30 UTC (rev 291017)
@@ -1,3 +1,19 @@
+2022-03-08  Chris Dumez  <[email protected]>
+
+        Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
+        https://bugs.webkit.org/show_bug.cgi?id=237605
+
+        Reviewed by Darin Adler.
+
+        Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
+        - https://github.com/whatwg/html/pull/7654#issuecomment-1054219407
+
+        There is no backward compatibility risk since support for this flag was added very recently
+        in r290958.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::frameSandboxAllowsOpeningExternalCustomProtocols):
+
 2022-03-08  Sihui Liu  <[email protected]>
 
         File System Access: throw exception if file or directory cannot be accessed in file system

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (291016 => 291017)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-03-08 23:27:30 UTC (rev 291017)
@@ -5363,7 +5363,7 @@
 // https://html.spec.whatwg.org/#hand-off-to-external-software
 static bool frameSandboxAllowsOpeningExternalCustomProtocols(SandboxFlags sandboxFlags, bool hasUserGesture)
 {
-    if (!(sandboxFlags & SandboxPopups) || !(sandboxFlags & SandboxTopNavigation) || !(sandboxFlags & SandboxCustomProtocolsNavigation))
+    if (!(sandboxFlags & SandboxPopups) || !(sandboxFlags & SandboxTopNavigation) || !(sandboxFlags & SandboxTopNavigationToCustomProtocols))
         return true;
 
     return !(sandboxFlags & SandboxTopNavigationByUserActivation) && hasUserGesture;

Modified: trunk/Tools/ChangeLog (291016 => 291017)


--- trunk/Tools/ChangeLog	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Tools/ChangeLog	2022-03-08 23:27:30 UTC (rev 291017)
@@ -1,3 +1,13 @@
+2022-03-08  Chris Dumez  <[email protected]>
+
+        Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
+        https://bugs.webkit.org/show_bug.cgi?id=237605
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
+        (TEST):
+
 2022-03-08  Jonathan Bedard  <[email protected]>
 
         [git-webkit] Prompt user when GitHub credentials are likely incorrect

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm (291016 => 291017)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm	2022-03-08 23:27:30 UTC (rev 291017)
@@ -898,7 +898,7 @@
 
 TEST(WKNavigation, LoadRadarURLFromSandboxedFrameAllowCustomProtocolsNavigation)
 {
-    const char* mainHTML = "<iframe src='' sandbox='allow-scripts allow-custom-protocols-navigation'></iframe>";
+    const char* mainHTML = "<iframe src='' sandbox='allow-scripts allow-top-navigation-to-custom-protocols'></iframe>";
     const char* frameHTML = "<a id='testLink' href=''>Link</a><script>setTimeout(() => { document.getElementById('testLink').click() }, 0);</script>";
 
     using namespace TestWebKitAPI;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to