⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285739 in webkit


Ignore:
Timestamp:
Nov 12, 2021, 1:23:59 PM (5 years ago)
Author:
Chris Dumez
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:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r285737 r285739  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=233059
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI until we reach
     9        agreement on a suitable API name.
     10
     11        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
     12        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
     13        (-[WKWebpagePreferences _setCaptivePortalModeEnabled:]):
     14        (-[WKWebpagePreferences _captivePortalModeEnabled]):
     15        (-[WKWebpagePreferences setCaptivePortalModeEnabled:]): Deleted.
     16        (-[WKWebpagePreferences captivePortalModeEnabled]): Deleted.
     17        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
     18
    1192021-11-12  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.h

    r285594 r285739  
    7272@property (nonatomic) BOOL allowsContentJavaScript WK_API_AVAILABLE(macos(11.0), ios(14.0));
    7373
    74 /*! @abstract A boolean indicating whether Captive Portal mode is enabled.
    75  @discussion The default value is NO on macOS. On iOS, the default value depends on the system setting.
    76  */
    77 @property (nonatomic) BOOL captivePortalModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    78 
    7974@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm

    r285594 r285739  
    392392}
    393393
    394 - (void)setCaptivePortalModeEnabled:(BOOL)captivePortalModeEnabled
     394- (void)_setCaptivePortalModeEnabled:(BOOL)captivePortalModeEnabled
    395395{
    396396#if PLATFORM(IOS_FAMILY)
     
    401401}
    402402
    403 - (BOOL)captivePortalModeEnabled
     403- (BOOL)_captivePortalModeEnabled
    404404{
    405405    return _websitePolicies->captivePortalModeEnabled();
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h

    r271813 r285739  
    8686@property (nonatomic, setter=_setMouseEventPolicy:) _WKWebsiteMouseEventPolicy _mouseEventPolicy WK_API_AVAILABLE(macos(11.0), ios(14.0));
    8787
     88@property (nonatomic, setter=_setCaptivePortalModeEnabled:) BOOL _captivePortalModeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
     89
    8890@end
  • trunk/Tools/ChangeLog

    r285733 r285739  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Demote WKWebpagePreferences.captivePortalModeEnabled API to SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=233059
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Update API test accordingly.
     9
     10        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
     11
    1122021-11-05  Jonathan Bedard  <jbedard@apple.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

    r285731 r285739  
    4646#import <WebKit/WKWebViewPrivateForTesting.h>
    4747#import <WebKit/WKWebpagePreferences.h>
     48#import <WebKit/WKWebpagePreferencesPrivate.h>
    4849#import <WebKit/WKWebsiteDataStorePrivate.h>
    4950#import <WebKit/WKWebsiteDataStoreRef.h>
     
    76807681{
    76817682    auto webViewConfiguration = adoptNS([WKWebViewConfiguration new]);
    7682     EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences.captivePortalModeEnabled);
     7683    EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences._captivePortalModeEnabled);
    76837684    [webViewConfiguration.get().preferences _setMediaDevicesEnabled:YES];
    76847685    webViewConfiguration.get().preferences._mediaCaptureRequiresSecureConnection = NO;
     
    77077708
    77087709    delegate.get().decidePolicyForNavigationActionWithPreferences = ^(WKNavigationAction *action, WKWebpagePreferences *preferences, void (^completionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
    7709         EXPECT_FALSE(preferences.captivePortalModeEnabled);
    7710         preferences.captivePortalModeEnabled = YES;
     7710        EXPECT_FALSE(preferences._captivePortalModeEnabled);
     7711        [preferences _setCaptivePortalModeEnabled:YES];
    77117712        completionHandler(WKNavigationActionPolicyAllow, preferences);
    77127713    };
     
    77267727{
    77277728    auto webViewConfiguration = adoptNS([WKWebViewConfiguration new]);
    7728     EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences.captivePortalModeEnabled);
    7729     webViewConfiguration.get().defaultWebpagePreferences.captivePortalModeEnabled = YES;
     7729    EXPECT_FALSE(webViewConfiguration.get().defaultWebpagePreferences._captivePortalModeEnabled);
     7730    [webViewConfiguration.get().defaultWebpagePreferences _setCaptivePortalModeEnabled:YES];
    77307731    [webViewConfiguration.get().preferences _setMediaDevicesEnabled:YES];
    77317732    webViewConfiguration.get().preferences._mediaCaptureRequiresSecureConnection = NO;
     
    77457746
    77467747    delegate.get().decidePolicyForNavigationActionWithPreferences = ^(WKNavigationAction *action, WKWebpagePreferences *preferences, void (^completionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
    7747         EXPECT_TRUE(preferences.captivePortalModeEnabled);
     7748        EXPECT_TRUE(preferences._captivePortalModeEnabled);
    77487749        completionHandler(WKNavigationActionPolicyAllow, preferences);
    77497750    };
     
    77677768
    77687769    delegate.get().decidePolicyForNavigationActionWithPreferences = ^(WKNavigationAction *action, WKWebpagePreferences *preferences, void (^completionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
    7769         EXPECT_TRUE(preferences.captivePortalModeEnabled);
    7770         preferences.captivePortalModeEnabled = NO; // Opt out of captive portal mode for this load.
     7770        EXPECT_TRUE(preferences._captivePortalModeEnabled);
     7771        [preferences _setCaptivePortalModeEnabled:NO]; // Opt out of captive portal mode for this load.
    77717772        completionHandler(WKNavigationActionPolicyAllow, preferences);
    77727773    };
Note: See TracChangeset for help on using the changeset viewer.