Don't enable default icon loading in WK1 for apps linked against old SDKs.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 23:53:04 +0000 (23:53 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 23:53:04 +0000 (23:53 +0000)
<rdar://problem/33724060> and https://bugs.webkit.org/show_bug.cgi?id=175342

Reviewed by Andy Estes.

* Misc/WebKitVersionChecks.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::getLoadDecisionForIcons): Don't do any icon loading unless
  the app is linked against new WebKit with the new behavior.

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

Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Misc/WebKitVersionChecks.h
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm

index 7817d0b..1e89aee 100644 (file)
@@ -1,3 +1,15 @@
+2017-08-08  Brady Eidson  <beidson@apple.com>
+
+        Don't enable default icon loading in WK1 for apps linked against old SDKs.
+        <rdar://problem/33724060> and https://bugs.webkit.org/show_bug.cgi?id=175342
+
+        Reviewed by Andy Estes.
+
+        * Misc/WebKitVersionChecks.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::getLoadDecisionForIcons): Don't do any icon loading unless
+          the app is linked against new WebKit with the new behavior.
+
 2017-08-07  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Preview Canvas path when viewing a recording
index 1f10ebc..4c8a11e 100644 (file)
@@ -61,6 +61,8 @@
 #define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 0x02170D00 // 535.13.0
 #define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 0x02190100 // 537.1.0
 #define WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING 0x02590116 // 601.1.22
+#define WEBKIT_FIRST_VERSION_WITH_DEFAULT_ICON_LOADING 0x025C0126 // 604.1.38
+
 #else
 // <rdar://problem/6627758> Need to implement WebKitLinkedOnOrAfter
 // Actually UIKit version numbers, since applications don't link against WebKit
index 0ab90e4..6fb059e 100644 (file)
@@ -54,6 +54,7 @@
 #import "WebKitErrorsPrivate.h"
 #import "WebKitLogging.h"
 #import "WebKitNSStringExtras.h"
+#import "WebKitVersionChecks.h"
 #import "WebNSURLExtras.h"
 #import "WebNavigationData.h"
 #import "WebNetscapePluginPackage.h"
 #import <WebCore/WAKScrollView.h>
 #import <WebCore/WAKWindow.h>
 #import <WebCore/WebCoreThreadMessage.h>
-#import "WebKitVersionChecks.h"
 #import "WebMailDelegate.h"
 #import "WebUIKitDelegate.h"
 #endif
@@ -2280,6 +2280,15 @@ void WebFrameLoaderClient::getLoadDecisionForIcons(const Vector<std::pair<WebCor
     DocumentLoader* documentLoader = frame->loader().documentLoader();
     ASSERT(documentLoader);
 
+#if PLATFORM(MAC)
+    if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_DEFAULT_ICON_LOADING)) {
+        for (auto& icon : icons)
+            documentLoader->didGetLoadDecisionForIcon(false, icon.second, 0);
+
+        return;
+    }
+#endif
+
     bool disallowedDueToImageLoadSettings = false;
     if (!frame->settings().loadsImagesAutomatically() && !frame->settings().loadsSiteIconsIgnoringImageLoadingSetting())
         disallowedDueToImageLoadSettings = true;