Changeset 244239 in webkit
- Timestamp:
- Apr 12, 2019, 8:54:10 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/RuntimeApplicationChecks.h (modified) (1 diff)
-
WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (modified) (3 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/WebCompatibilityMode.h (modified) (1 diff)
-
WebKit/Shared/WebPreferences.yaml (modified) (1 diff)
-
WebKit/Shared/WebPreferencesDefaultValues.h (modified) (1 diff)
-
WebKit/UIProcess/API/APIWebsitePolicies.h (modified) (1 diff)
-
WebKit/UIProcess/API/Cocoa/WKNavigationDelegate.h (modified) (1 diff)
-
WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.h (modified) (1 diff)
-
WebKit/UIProcess/Cocoa/NavigationState.mm (modified) (3 diffs)
-
WebKit/UIProcess/Cocoa/VersionChecks.h (modified) (2 diffs)
-
WebKit/UIProcess/ios/WebPageProxyIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244235 r244239 1 2019-04-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable modern compatibility mode by default in WKWebView on some devices 4 https://bugs.webkit.org/show_bug.cgi?id=196883 5 <rdar://problem/49864527> 6 7 Reviewed by Tim Horton. 8 9 Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring 10 compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with 11 a bundle ID that begins with "com.apple.". 12 13 * platform/RuntimeApplicationChecks.h: 14 * platform/cocoa/RuntimeApplicationChecksCocoa.mm: 15 (WebCore::setApplicationBundleIdentifier): 16 (WebCore::applicationBundleStartsWith): 17 (WebCore::IOSApplication::isAppleApplication): 18 1 19 2019-04-12 Justin Fan <justin_fan@apple.com> 2 20 -
trunk/Source/WebCore/platform/RuntimeApplicationChecks.h
r239880 r244239 92 92 bool isMoviStarPlus(); 93 93 WEBCORE_EXPORT bool isFirefox(); 94 WEBCORE_EXPORT bool isAppleApplication(); 94 95 95 96 } // IOSApplication -
trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
r239880 r244239 63 63 { 64 64 ASSERT(RunLoop::isMain()); 65 ASSERT_WITH_MESSAGE(!applicationBundleIdentifierOverrideWasQueried, "applicationBundleIsEqualTo() should not be called before setApplicationBundleIdentifier()");65 ASSERT_WITH_MESSAGE(!applicationBundleIdentifierOverrideWasQueried, "applicationBundleIsEqualTo() and applicationBundleStartsWith() should not be called before setApplicationBundleIdentifier()"); 66 66 applicationBundleIdentifierOverride() = bundleIdentifier; 67 67 } … … 191 191 192 192 #if PLATFORM(IOS_FAMILY) 193 194 static bool applicationBundleStartsWith(const String& bundleIdentifierPrefix) 195 { 196 return applicationBundleIdentifier().startsWith(bundleIdentifierPrefix); 197 } 193 198 194 199 bool IOSApplication::isMobileMail() … … 284 289 } 285 290 291 bool IOSApplication::isAppleApplication() 292 { 293 static bool isAppleApplication = applicationBundleStartsWith("com.apple."_s); 294 return isAppleApplication; 295 } 296 286 297 #endif 287 298 -
trunk/Source/WebKit/ChangeLog
r244236 r244239 1 2019-04-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Enable modern compatibility mode by default in WKWebView on some devices 4 https://bugs.webkit.org/show_bug.cgi?id=196883 5 <rdar://problem/49864527> 6 7 Reviewed by Tim Horton. 8 9 Make some minor adjustments to new API. 10 11 * Shared/WebCompatibilityMode.h: 12 13 Rename WebCompatibilityMode::Default to WebCompatibilityMode::Recommended. 14 15 * Shared/WebPreferences.yaml: 16 * Shared/WebPreferencesDefaultValues.h: 17 18 Now that the role of the UseModernCompatibilityModeByDefault debug preference is limited to bypassing linked-on- 19 or-after and app bundle compatibility hacks, we no longer make this default to true in iOSMac. 20 21 * UIProcess/API/APIWebsitePolicies.h: 22 * UIProcess/API/Cocoa/WKNavigationDelegate.h: 23 24 Rename the withPreferences: label to just preferences:. 25 26 * UIProcess/API/Cocoa/WKWebViewConfiguration.h: 27 * UIProcess/Cocoa/NavigationState.mm: 28 (WebKit::NavigationState::setNavigationDelegate): 29 (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 30 * UIProcess/Cocoa/VersionChecks.h: 31 * UIProcess/ios/WebPageProxyIOS.mm: 32 1 33 2019-04-12 Brian Burg <bburg@apple.com> 2 34 -
trunk/Source/WebKit/Shared/WebCompatibilityMode.h
r243797 r244239 31 31 32 32 enum class WebCompatibilityMode { 33 Default,33 Recommended, 34 34 Legacy, 35 35 Modern, -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r244228 r244239 1061 1061 UseModernCompatibilityModeByDefault: 1062 1062 type: bool 1063 defaultValue: USE_MODERN_COMPATIBILITY_MODE_BY_DEFAULT1063 defaultValue: false 1064 1064 humanReadableName: "Use Modern Compatibility Mode" 1065 1065 humanReadableDescription: "Use modern compatibility mode by default" -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r244203 r244239 267 267 #define DEFAULT_APPLE_PAY_ENABLED false 268 268 #endif 269 270 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC)271 #define USE_MODERN_COMPATIBILITY_MODE_BY_DEFAULT false272 #else273 #define USE_MODERN_COMPATIBILITY_MODE_BY_DEFAULT true274 #endif -
trunk/Source/WebKit/UIProcess/API/APIWebsitePolicies.h
r244218 r244239 112 112 WTF::String m_customJavaScriptUserAgentAsSiteSpecificQuirks; 113 113 WTF::String m_customNavigatorPlatform; 114 WebKit::WebCompatibilityMode m_preferredCompatibilityMode { WebKit::WebCompatibilityMode:: Default};114 WebKit::WebCompatibilityMode m_preferredCompatibilityMode { WebKit::WebCompatibilityMode::Recommended }; 115 115 WebKit::WebsiteMetaViewportPolicy m_metaViewportPolicy { WebKit::WebsiteMetaViewportPolicy::Default }; 116 116 WebKit::WebsiteMediaSourcePolicy m_mediaSourcePolicy { WebKit::WebsiteMediaSourcePolicy::Default }; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegate.h
r243787 r244239 87 87 -webView:decidePolicyForNavigationAction:decisionHandler: will not be called. 88 88 */ 89 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction withPreferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));89 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 90 90 91 91 /*! @abstract Decides whether to allow or cancel a navigation after its -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.h
r243787 r244239 133 133 /*! @abstract The set of default webpage preferences to use when loading and rendering content. 134 134 @discussion These default webpage preferences are additionally passed to the navigation delegate 135 in -webView:decidePolicyForNavigationAction: withPreferences:decisionHandler:.135 in -webView:decidePolicyForNavigationAction:preferences:decisionHandler:. 136 136 */ 137 137 @property (null_resettable, nonatomic, copy) WKWebpagePreferences *defaultWebpagePreferences WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
r244197 r244239 150 150 151 151 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:decisionHandler:)]; 152 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction: withPreferences:decisionHandler:)];152 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionWithPreferencesDecisionHandler = [delegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:preferences:decisionHandler:)]; 153 153 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies = [delegate respondsToSelector:@selector(_webView:decidePolicyForNavigationAction:decisionHandler:)]; 154 154 m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionUserInfoDecisionHandlerWebsitePolicies = [delegate respondsToSelector:@selector(_webView:decidePolicyForNavigationAction:userInfo:decisionHandler:)]; … … 561 561 auto selectorForCompletionHandlerChecker = ([&] () -> SEL { 562 562 if (delegateHasWebpagePreferences) 563 return @selector(webView:decidePolicyForNavigationAction: withPreferences:decisionHandler:);563 return @selector(webView:decidePolicyForNavigationAction:preferences:decisionHandler:); 564 564 if (delegateHasWebsitePolicies) 565 565 return @selector(_webView:decidePolicyForNavigationAction:decisionHandler:); … … 632 632 633 633 if (delegateHasWebpagePreferences) 634 [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) withPreferences:wrapper(defaultWebsitePolicies) decisionHandler:makeBlockPtr(WTFMove(decisionHandlerWithPreferencesOrPolicies)).get()];634 [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:wrapper(navigationAction) preferences:wrapper(defaultWebsitePolicies) decisionHandler:makeBlockPtr(WTFMove(decisionHandlerWithPreferencesOrPolicies)).get()]; 635 635 else if (delegateHasWebsitePolicies) { 636 636 auto decisionHandler = makeBlockPtr(WTFMove(decisionHandlerWithPreferencesOrPolicies)); -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h
r244203 r244239 36 36 #define DYLD_IOS_VERSION_FIRST_WHERE_DOWNLOAD_ATTRIBUTE_DOES_NOT_OVERRIDE_NAVIGATION_DELEGATE 0 37 37 #define DYLD_IOS_VERSION_FIRST_THAT_DECIDES_POLICY_BEFORE_LOADING_QUICK_LOOK_PREVIEW 0 38 #define DYLD_IOS_VERSION_FIRST_WITH_MODERN_COMPATIBILITY_MODE_BY_DEFAULT 0 38 39 #define DYLD_MACOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES 0 39 40 #define DYLD_MACOS_VERSION_FIRST_WHERE_DOWNLOAD_ATTRIBUTE_DOES_NOT_OVERRIDE_NAVIGATION_DELEGATE 0 … … 72 73 FirstThatDecidesPolicyBeforeLoadingQuickLookPreview = DYLD_IOS_VERSION_FIRST_THAT_DECIDES_POLICY_BEFORE_LOADING_QUICK_LOOK_PREVIEW, 73 74 FirstWithExceptionsForRelatedWebViewsUsingDifferentDataStores = DYLD_IOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES, 75 FirstWithModernCompabilityModeByDefault = DYLD_IOS_VERSION_FIRST_WITH_MODERN_COMPATIBILITY_MODE_BY_DEFAULT, 74 76 #elif PLATFORM(MAC) 75 77 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r244151 r244239 59 59 #import <WebCore/NotImplemented.h> 60 60 #import <WebCore/PlatformScreen.h> 61 #import <WebCore/RuntimeApplicationChecks.h> 61 62 #import <WebCore/SharedBuffer.h> 62 63 #import <WebCore/UserAgent.h>
Note:
See TracChangeset
for help on using the changeset viewer.