Title: [285739] trunk
Revision
285739
Author
[email protected]
Date
2021-11-12 13:23:59 -0800 (Fri, 12 Nov 2021)

Log Message

Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI
https://bugs.webkit.org/show_bug.cgi?id=233059

Reviewed by Geoffrey Garen.

Source/WebKit:

Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI until we reach
agreement on a suitable API name.

* UIProcess/API/Cocoa/WKWebpagePreferences.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
(-[WKWebpagePreferences _setCaptivePortalModeEnabled:]):
(-[WKWebpagePreferences _captivePortalModeEnabled]):
(-[WKWebpagePreferences setCaptivePortalModeEnabled:]): Deleted.
(-[WKWebpagePreferences captivePortalModeEnabled]): Deleted.
* UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:

Tools:

Update API test accordingly.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (285738 => 285739)


--- trunk/Source/WebKit/ChangeLog	2021-11-12 21:22:47 UTC (rev 285738)
+++ trunk/Source/WebKit/ChangeLog	2021-11-12 21:23:59 UTC (rev 285739)
@@ -1,5 +1,23 @@
 2021-11-12  Chris Dumez  <[email protected]>
 
+        Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI
+        https://bugs.webkit.org/show_bug.cgi?id=233059
+
+        Reviewed by Geoffrey Garen.
+
+        Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI until we reach
+        agreement on a suitable API name.
+
+        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
+        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
+        (-[WKWebpagePreferences _setCaptivePortalModeEnabled:]):
+        (-[WKWebpagePreferences _captivePortalModeEnabled]):
+        (-[WKWebpagePreferences setCaptivePortalModeEnabled:]): Deleted.
+        (-[WKWebpagePreferences captivePortalModeEnabled]): Deleted.
+        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
+
+2021-11-12  Chris Dumez  <[email protected]>
+
         Rename ProcessLauncherMac.mm to ProcessLauncherCocoa.mm
         https://bugs.webkit.org/show_bug.cgi?id=233045
         <rdar://problem/85347107>

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.h (285738 => 285739)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.h	2021-11-12 21:22:47 UTC (rev 285738)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.h	2021-11-12 21:23:59 UTC (rev 285739)
@@ -71,9 +71,4 @@
 */
 @property (nonatomic) BOOL allowsContentJavaScript WK_API_AVAILABLE(macos(11.0), ios(14.0));
 
-/*! @abstract A boolean indicating whether Captive Portal mode is enabled.
- @discussion The default value is NO on macOS. On iOS, the default value depends on the system setting.
- */
-@property (nonatomic) BOOL captivePortalModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
-
 @end

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm (285738 => 285739)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm	2021-11-12 21:22:47 UTC (rev 285738)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm	2021-11-12 21:23:59 UTC (rev 285739)
@@ -391,7 +391,7 @@
     }
 }
 
-- (void)setCaptivePortalModeEnabled:(BOOL)captivePortalModeEnabled
+- (void)_setCaptivePortalModeEnabled:(BOOL)captivePortalModeEnabled
 {
 #if PLATFORM(IOS_FAMILY)
     if (!WTF::processHasEntitlement("com.apple.developer.web-browser"))
@@ -400,7 +400,7 @@
     _websitePolicies->setCaptivePortalModeEnabled(!!captivePortalModeEnabled);
 }
 
-- (BOOL)captivePortalModeEnabled
+- (BOOL)_captivePortalModeEnabled
 {
     return _websitePolicies->captivePortalModeEnabled();
 }

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h (285738 => 285739)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h	2021-11-12 21:22:47 UTC (rev 285738)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h	2021-11-12 21:23:59 UTC (rev 285739)
@@ -85,4 +85,6 @@
 
 @property (nonatomic, setter=_setMouseEventPolicy:) _WKWebsiteMouseEventPolicy _mouseEventPolicy WK_API_AVAILABLE(macos(11.0), ios(14.0));
 
+@property (nonatomic, setter=_setCaptivePortalModeEnabled:) BOOL _captivePortalModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
 @end

Modified: trunk/Tools/ChangeLog (285738 => 285739)


--- trunk/Tools/ChangeLog	2021-11-12 21:22:47 UTC (rev 285738)
+++ trunk/Tools/ChangeLog	2021-11-12 21:23:59 UTC (rev 285739)
@@ -1,3 +1,14 @@
+2021-11-12  Chris Dumez  <[email protected]>
+
+        Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI
+        https://bugs.webkit.org/show_bug.cgi?id=233059
+
+        Reviewed by Geoffrey Garen.
+
+        Update API test accordingly.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2021-11-05  Jonathan Bedard  <[email protected]>
 
         [git-webkit] Open closed pull-request when running pr

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (285738 => 285739)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2021-11-12 21:22:47 UTC (rev 285738)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2021-11-12 21:23:59 UTC (rev 285739)
@@ -45,6 +45,7 @@
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WKWebViewPrivateForTesting.h>
 #import <WebKit/WKWebpagePreferences.h>
+#import <WebKit/WKWebpagePreferencesPrivate.h>
 #import <WebKit/WKWebsiteDataStorePrivate.h>
 #import <WebKit/WKWebsiteDataStoreRef.h>
 #import <WebKit/WebKit.h>
@@ -7679,7 +7680,7 @@
 TEST(ProcessSwap, NavigatingToCaptivePortalMode)
 {
     auto webViewConfiguration = adoptNS([WKWebViewConfiguration new]);
-    EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences.captivePortalModeEnabled);
+    EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences._captivePortalModeEnabled);
     [webViewConfiguration.get().preferences _setMediaDevicesEnabled:YES];
     webViewConfiguration.get().preferences._mediaCaptureRequiresSecureConnection = NO;
 
@@ -7706,8 +7707,8 @@
     checkSettingsControlledByCaptivePortalMode(webView.get(), ShouldBeEnabled::Yes);
 
     delegate.get().decidePolicyForNavigationActionWithPreferences = ^(WKNavigationAction *action, WKWebpagePreferences *preferences, void (^completionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
-        EXPECT_FALSE(preferences.captivePortalModeEnabled);
-        preferences.captivePortalModeEnabled = YES;
+        EXPECT_FALSE(preferences._captivePortalModeEnabled);
+        [preferences _setCaptivePortalModeEnabled:YES];
         completionHandler(WKNavigationActionPolicyAllow, preferences);
     };
 
@@ -7725,8 +7726,8 @@
 TEST(ProcessSwap, CaptivePortalModeEnabledByDefaultThenOptOut)
 {
     auto webViewConfiguration = adoptNS([WKWebViewConfiguration new]);
-    EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences.captivePortalModeEnabled);
-    webViewConfiguration.get().defaultWebpagePreferences.captivePortalModeEnabled = YES;
+    EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences._captivePortalModeEnabled);
+    [webViewConfiguration.get().defaultWebpagePreferences _setCaptivePortalModeEnabled:YES];
     [webViewConfiguration.get().preferences _setMediaDevicesEnabled:YES];
     webViewConfiguration.get().preferences._mediaCaptureRequiresSecureConnection = NO;
 
@@ -7744,7 +7745,7 @@
     };
 
     delegate.get().decidePolicyForNavigationActionWithPreferences = ^(WKNavigationAction *action, WKWebpagePreferences *preferences, void (^completionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
-        EXPECT_TRUE(preferences.captivePortalModeEnabled);
+        EXPECT_TRUE(preferences._captivePortalModeEnabled);
         completionHandler(WKNavigationActionPolicyAllow, preferences);
     };
 
@@ -7766,8 +7767,8 @@
     checkSettingsControlledByCaptivePortalMode(webView.get(), ShouldBeEnabled::No);
 
     delegate.get().decidePolicyForNavigationActionWithPreferences = ^(WKNavigationAction *action, WKWebpagePreferences *preferences, void (^completionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
-        EXPECT_TRUE(preferences.captivePortalModeEnabled);
-        preferences.captivePortalModeEnabled = NO; // Opt out of captive portal mode for this load.
+        EXPECT_TRUE(preferences._captivePortalModeEnabled);
+        [preferences _setCaptivePortalModeEnabled:NO]; // Opt out of captive portal mode for this load.
         completionHandler(WKNavigationActionPolicyAllow, preferences);
     };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to