Changeset 244203 in webkit
- Timestamp:
- Apr 11, 2019 4:43:10 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244202 r244203 1 2019-04-11 Chris Dumez <cdumez@apple.com> 2 3 Unable to run system Safari with trunk WebKit 4 https://bugs.webkit.org/show_bug.cgi?id=196777 5 <rdar://problem/49784574> 6 7 Reviewed by Alex Christensen. 8 9 * UIProcess/API/Cocoa/WKWebView.mm: 10 (-[WKWebView _initializeWithConfiguration:]): 11 Add a linkedOnAfter check so that throwing exceptions when related web views use a different 12 data store only happens for apps rebuilt using recent SDK. 13 14 * UIProcess/Cocoa/VersionChecks.h: 15 * UIProcess/Cocoa/VersionChecks.mm: 16 (WebKit::linkedOnOrAfter): 17 - By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my 18 use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can 19 be controlled by the caller. 20 - In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the 21 non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return 22 true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the 23 0 value for sdkVersion. 24 1 25 2019-04-11 Zalan Bujtas <zalan@apple.com> 2 26 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r244202 r244203 15 15 DeviceOrientationPermissionAPIEnabled: 16 16 type: bool 17 defaultValue: defaultDeviceOrientationPermissionAPIEnabled()17 defaultValue: false 18 18 condition: ENABLE(DEVICE_ORIENTATION) 19 19 webcoreName: deviceOrientationPermissionAPIEnabled 20 humanReadableName: "Permission API for device orientation / motion access."21 humanReadableDescription: "DeviceOrientationEvent.requestPermission() / DeviceMotionEvent.requestPermission()"22 category: experimental23 20 24 21 JavaScriptEnabled: -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
r242664 r244203 45 45 } 46 46 47 bool defaultDeviceOrientationPermissionAPIEnabled()48 {49 #if PLATFORM(IOS) && ENABLE(DEVICE_ORIENTATION)50 return linkedOnOrAfter(WebKit::SDKVersion::FirstWithDeviceOrientationAndMotionPermissionAPI);51 #else52 return false;53 #endif54 }55 56 47 bool defaultCustomPasteboardDataEnabled() 57 48 { -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r244140 r244203 232 232 233 233 bool defaultPassiveTouchListenersAsDefaultOnDocument(); 234 bool defaultDeviceOrientationPermissionAPIEnabled();235 234 bool defaultCustomPasteboardDataEnabled(); 236 235 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r244170 r244203 553 553 if (processPool && processPool != relatedWebViewProcessPool) 554 554 [NSException raise:NSInvalidArgumentException format:@"Related web view %@ has process pool %@ but configuration specifies a different process pool %@", relatedWebView, relatedWebViewProcessPool, configuration.processPool]; 555 if ([relatedWebView->_configuration websiteDataStore] != [_configuration websiteDataStore] )555 if ([relatedWebView->_configuration websiteDataStore] != [_configuration websiteDataStore] && linkedOnOrAfter(WebKit::SDKVersion::FirstWithExceptionsForRelatedWebViewsUsingDifferentDataStores, WebKit::AssumeSafariIsAlwaysLinkedOnAfter::No)) 556 556 [NSException raise:NSInvalidArgumentException format:@"Related web view %@ has data store %@ but configuration specifies a different data store %@", relatedWebView, [relatedWebView->_configuration websiteDataStore], [_configuration websiteDataStore]]; 557 557 … … 629 629 pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::allowSettingAnyXHRHeaderFromFileURLsKey(), WebKit::WebPreferencesStore::Value(shouldAllowSettingAnyXHRHeaderFromFileURLs())); 630 630 pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::shouldDecidePolicyBeforeLoadingQuickLookPreviewKey(), WebKit::WebPreferencesStore::Value(!![_configuration _shouldDecidePolicyBeforeLoadingQuickLookPreview])); 631 #if ENABLE(DEVICE_ORIENTATION) 632 pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::deviceOrientationPermissionAPIEnabledKey(), WebKit::WebPreferencesStore::Value(linkedOnOrAfter(WebKit::SDKVersion::FirstWithDeviceOrientationAndMotionPermissionAPI))); 633 #endif 631 634 #if USE(SYSTEM_PREVIEW) 632 635 pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::systemPreviewEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _systemPreviewEnabled])); -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h
r244170 r244203 40 40 #endif 41 41 42 #ifndef DYLD_IOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES 43 #define DYLD_IOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES 0 44 #endif 45 #ifndef DYLD_MACOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES 46 #define DYLD_MACOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES 0 47 #endif 48 42 49 #ifndef DYLD_IOS_VERSION_FIRST_WITH_DEVICE_ORIENTATION_AND_MOTION_PERMISSION_API 43 50 #define DYLD_IOS_VERSION_FIRST_WITH_DEVICE_ORIENTATION_AND_MOTION_PERMISSION_API 0 … … 64 71 FirstWithDeviceOrientationAndMotionPermissionAPI = DYLD_IOS_VERSION_FIRST_WITH_DEVICE_ORIENTATION_AND_MOTION_PERMISSION_API, 65 72 FirstThatDecidesPolicyBeforeLoadingQuickLookPreview = DYLD_IOS_VERSION_FIRST_THAT_DECIDES_POLICY_BEFORE_LOADING_QUICK_LOOK_PREVIEW, 73 FirstWithExceptionsForRelatedWebViewsUsingDifferentDataStores = DYLD_IOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES, 66 74 #elif PLATFORM(MAC) 67 75 FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11, … … 72 80 FirstWithSnapshotAfterScreenUpdates = DYLD_MACOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES, 73 81 FirstWhereDownloadAttributeDoesNotOverrideNavigationDelegate = DYLD_MACOS_VERSION_FIRST_WHERE_DOWNLOAD_ATTRIBUTE_DOES_NOT_OVERRIDE_NAVIGATION_DELEGATE, 82 FirstWithExceptionsForRelatedWebViewsUsingDifferentDataStores = DYLD_MACOS_VERSION_FIRST_WITH_EXCEPTIONS_FOR_RELATED_WEBVIEWS_USING_DIFFERENT_DATA_STORES, 74 83 #endif 75 84 }; 76 85 77 bool linkedOnOrAfter(SDKVersion); 86 enum class AssumeSafariIsAlwaysLinkedOnAfter : bool { No, Yes }; 87 bool linkedOnOrAfter(SDKVersion, AssumeSafariIsAlwaysLinkedOnAfter = AssumeSafariIsAlwaysLinkedOnAfter::Yes); 78 88 79 89 } -
trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.mm
r244170 r244203 35 35 static NSString * const WebKitLinkedOnOrAfterEverythingKey = @"WebKitLinkedOnOrAfterEverything"; 36 36 37 bool linkedOnOrAfter(SDKVersion sdkVersion )37 bool linkedOnOrAfter(SDKVersion sdkVersion, AssumeSafariIsAlwaysLinkedOnAfter assumeSafariIsAlwaysLinkedOnAfter) 38 38 { 39 static bool linkedOnOrAfterEverything;40 static std::once_flag once;41 std::call_once(once, [] {42 bool isSafari = false;39 static bool linkedOnOrAfterEverything = false; 40 static bool isSafari = false; 41 static std::once_flag once; 42 std::call_once(once, [] { 43 43 #if PLATFORM(IOS_FAMILY) 44 44 if (WebCore::IOSApplication::isMobileSafari()) … … 49 49 #endif 50 50 51 if ( isSafari ||[[NSUserDefaults standardUserDefaults] boolForKey:WebKitLinkedOnOrAfterEverythingKey])51 if ([[NSUserDefaults standardUserDefaults] boolForKey:WebKitLinkedOnOrAfterEverythingKey]) 52 52 linkedOnOrAfterEverything = true; 53 53 }); 54 54 55 return linkedOnOrAfterEverything ? true : dyld_get_program_sdk_version() >= static_cast<uint32_t>(sdkVersion); 55 if (UNLIKELY(linkedOnOrAfterEverything)) 56 return true; 57 58 if (isSafari && assumeSafariIsAlwaysLinkedOnAfter == AssumeSafariIsAlwaysLinkedOnAfter::Yes) 59 return true; 60 61 auto sdkVersionAsInteger = static_cast<uint32_t>(sdkVersion); 62 return sdkVersionAsInteger && dyld_get_program_sdk_version() >= sdkVersionAsInteger; 56 63 } 57 64
Note: See TracChangeset
for help on using the changeset viewer.