Ensure old binaries have old snapshotting behaviors
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 18:23:43 +0000 (18:23 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2019 18:23:43 +0000 (18:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194449
-and corresponding-
rdar://problem/47931954

Reviewed by Darin Adler.

Make sure that a nil configuration behaves the same way that it used to on apps
that were linked before FirstWithSnapshotAfterScreenUpdates

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
* UIProcess/Cocoa/VersionChecks.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241303 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/Cocoa/VersionChecks.h

index 424cdd8..ce65a9e 100644 (file)
@@ -1,3 +1,19 @@
+2019-02-08  Beth Dakin  <bdakin@apple.com>
+
+        Ensure old binaries have old snapshotting behaviors
+        https://bugs.webkit.org/show_bug.cgi?id=194449
+        -and corresponding-
+        rdar://problem/47931954
+
+        Reviewed by Darin Adler.
+
+        Make sure that a nil configuration behaves the same way that it used to on apps 
+        that were linked before FirstWithSnapshotAfterScreenUpdates
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
+        * UIProcess/Cocoa/VersionChecks.h:
+
 2019-02-12  Andy Estes  <aestes@apple.com>
 
         [iOSMac] Enable Parental Controls Content Filtering
index 26d8ca0..5e63e83 100644 (file)
@@ -1185,7 +1185,7 @@ static WKErrorCode callbackErrorCode(WebKit::CallbackBase::Error error)
         }];
     };
 
-    if (snapshotConfiguration && !snapshotConfiguration.afterScreenUpdates) {
+    if ((snapshotConfiguration && !snapshotConfiguration.afterScreenUpdates) || !linkedOnOrAfter(WebKit::SDKVersion::FirstWithSnapshotAfterScreenUpdates)) {
         callSnapshotRect();
         return;
     }
index a9c03ce..583fbf7 100644 (file)
@@ -32,6 +32,8 @@
 #else
 #define DYLD_IOS_VERSION_FIRST_WITH_LAZY_GESTURE_RECOGNIZER_INSTALLATION 0
 #define DYLD_IOS_VERSION_FIRST_WITH_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION 0
+#define DYLD_IOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES 0
+#define DYLD_MACOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES 0
 #endif
 
 namespace WebKit {
@@ -50,12 +52,14 @@ enum class SDKVersion : uint32_t {
     FirstWithMainThreadReleaseAssertionInWebPageProxy = DYLD_IOS_VERSION_12_0,
     FirstWithLazyGestureRecognizerInstallation = DYLD_IOS_VERSION_FIRST_WITH_LAZY_GESTURE_RECOGNIZER_INSTALLATION,
     FirstWithProcessSwapOnCrossSiteNavigation = DYLD_IOS_VERSION_FIRST_WITH_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION,
+    FirstWithSnapshotAfterScreenUpdates = DYLD_IOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES,
 #elif PLATFORM(MAC)
     FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,
     FirstWithDropToNavigateDisallowedByDefault = DYLD_MACOSX_VERSION_10_13,
     FirstWithExpiredOnlyReloadBehavior = DYLD_MACOSX_VERSION_10_13,
     FirstWithMainThreadReleaseAssertionInWebPageProxy = DYLD_MACOSX_VERSION_10_14,
+    FirstWithSnapshotAfterScreenUpdates = DYLD_MACOS_VERSION_FIRST_WITH_SNAPSHOT_AFTER_SCREEN_UPDATES,
 #endif
 };