Remove some obsolete WebKitVersionChecks.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Jul 2017 21:26:15 +0000 (21:26 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Jul 2017 21:26:15 +0000 (21:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174294

Reviewed by Dan Bernstein.

Source/WebCore:

No new tests (No change to testable behavior)

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::dispatchErrorEvent):

* page/Settings.in:

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isOkCupid): Deleted.
(WebCore::IOSApplication::isFacebook): Deleted.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::layoutOverflowRectForPropagation):

Source/WebKit/ios:

* WebView/WebPDFViewIOS.mm:
(-[WebPDFView drawPage:]):

Source/WebKit/mac:

* Misc/WebKitVersionChecks.h:

* WebView/WebHTMLView.mm:
(-[WebHTMLView hitTest:]):

* WebView/WebView.mm:
(shouldRespectPriorityInCSSAttributeSetters):
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _preferencesChanged:]):
(shouldTransformsAffectOverflow): Deleted.
(shouldDispatchJavaScriptWindowOnErrorEvents): Deleted.

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/page/Settings.in
Source/WebCore/platform/RuntimeApplicationChecks.h
Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
Source/WebCore/rendering/RenderBox.cpp
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebView/WebPDFViewIOS.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitVersionChecks.h
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 9536894..d471479 100644 (file)
@@ -1,3 +1,25 @@
+2017-07-09  Brady Eidson  <beidson@apple.com>
+
+        Remove some obsolete WebKitVersionChecks.
+        https://bugs.webkit.org/show_bug.cgi?id=174294
+
+        Reviewed by Dan Bernstein.
+
+        No new tests (No change to testable behavior)
+
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::dispatchErrorEvent):
+        
+        * page/Settings.in:
+        
+        * platform/RuntimeApplicationChecks.h:
+        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+        (WebCore::IOSApplication::isOkCupid): Deleted.
+        (WebCore::IOSApplication::isFacebook): Deleted.
+        
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::layoutOverflowRectForPropagation):
+
 2017-07-08  Brady Eidson  <beidson@apple.com>
 
         Remove some obsolete RuntimeApplicationChecks.
index 7113db1..bc03111 100644 (file)
@@ -417,13 +417,6 @@ bool ScriptExecutionContext::dispatchErrorEvent(const String& errorMessage, int
     if (!target)
         return false;
 
-#if PLATFORM(IOS)
-    if (target->toDOMWindow() && is<Document>(*this)) {
-        if (!downcast<Document>(*this).settings().shouldDispatchJavaScriptWindowOnErrorEvents())
-            return false;
-    }
-#endif
-
     String message = errorMessage;
     int line = lineNumber;
     int column = columnNumber;
index 29f4385..99ab2bc 100644 (file)
@@ -224,8 +224,6 @@ maxParseDuration type=double, initial=-1
 standalone initial=false
 telephoneNumberParsingEnabled initial=false
 mediaDataLoadsAutomatically initial=defaultMediaDataLoadsAutomatically
-shouldTransformsAffectOverflow initial=true
-shouldDispatchJavaScriptWindowOnErrorEvents initial=false
 alwaysUseAcceleratedOverflowScroll initial=false
 imageControlsEnabled initial=false, conditional=SERVICE_CONTROLS
 
index 78c90db..14fed9e 100644 (file)
@@ -71,8 +71,6 @@ WEBCORE_EXPORT bool isWebBookmarksD();
 bool isDumpRenderTree();
 bool isMobileStore();
 WEBCORE_EXPORT bool isWebApp();
-WEBCORE_EXPORT bool isOkCupid();
-WEBCORE_EXPORT bool isFacebook();
 WEBCORE_EXPORT bool isWebProcess();
 bool isIBooks();
 WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
index 803f42f..9ed6f48 100644 (file)
@@ -204,18 +204,6 @@ bool IOSApplication::isWebApp()
     return isWebApp;
 }
 
-bool IOSApplication::isOkCupid()
-{
-    static bool isOkCupid = applicationBundleIsEqualTo("com.okcupid.app");
-    return isOkCupid;
-}
-
-bool IOSApplication::isFacebook()
-{
-    static bool isFacebook = applicationBundleIsEqualTo("com.facebook.Facebook");
-    return isFacebook;
-}
-
 // FIXME: this needs to be changed when the WebProcess is changed to an XPC service.
 bool IOSApplication::isWebProcess()
 {
index e1efea7..bc72cd9 100644 (file)
@@ -4841,11 +4841,7 @@ LayoutRect RenderBox::layoutOverflowRectForPropagation(const RenderStyle* parent
         rect.unite(layoutOverflowRect());
 
     bool hasTransform = this->hasTransform();
-#if PLATFORM(IOS)
-    if (isInFlowPositioned() || (hasTransform && settings().shouldTransformsAffectOverflow())) {
-#else
     if (isInFlowPositioned() || hasTransform) {
-#endif
         // If we are relatively positioned or if we have a transform, then we have to convert
         // this rectangle into physical coordinates, apply relative positioning and transforms
         // to it, and then convert it back.
index b2dba6b..5f88f30 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-09  Brady Eidson  <beidson@apple.com>
+
+        Remove some obsolete WebKitVersionChecks.
+        https://bugs.webkit.org/show_bug.cgi?id=174294
+
+        Reviewed by Dan Bernstein.
+
+        * WebView/WebPDFViewIOS.mm:
+        (-[WebPDFView drawPage:]):
+
 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
 
         [WTF] Move SoftLinking.h into WTF
index 0becacd..ca6661b 100644 (file)
@@ -122,8 +122,7 @@ static CGColorRef createCGColorWithDeviceWhite(CGFloat white, CGFloat alpha)
     
     // Draw page.
     CGContextSaveGState(context);
-    CGFloat height = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_FLIPPED_SHADOWS) ? 2.0f : -2.0f;
-    CGContextSetShadowWithColor(context, CGSizeMake(0.0f, height), 3.0f, [[self class] shadowColor]);
+    CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 2.0f), 3.0f, [[self class] shadowColor]);
     CGContextSetFillColorWithColor(context, cachedCGColor(Color::white));
     CGContextFillRect(context, pageRect);
     CGContextRestoreGState(context);    
index b3fcf21..7d4111a 100644 (file)
@@ -1,3 +1,22 @@
+2017-07-09  Brady Eidson  <beidson@apple.com>
+
+        Remove some obsolete WebKitVersionChecks.
+        https://bugs.webkit.org/show_bug.cgi?id=174294
+
+        Reviewed by Dan Bernstein.
+
+        * Misc/WebKitVersionChecks.h:
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView hitTest:]):
+
+        * WebView/WebView.mm:
+        (shouldRespectPriorityInCSSAttributeSetters):
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (-[WebView _preferencesChanged:]):
+        (shouldTransformsAffectOverflow): Deleted.
+        (shouldDispatchJavaScriptWindowOnErrorEvents): Deleted.
+
 2017-07-08  Brady Eidson  <beidson@apple.com>
 
         Remove some obsolete RuntimeApplicationChecks.
index 2c38be1..1f10ebc 100644 (file)
 #else
 // <rdar://problem/6627758> Need to implement WebKitLinkedOnOrAfter
 // Actually UIKit version numbers, since applications don't link against WebKit
-#define WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION 229 // iOS 2.0
-#define WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION 818 // iOS 3.0
-#define WEBKIT_FIRST_VERSION_WITH_FLIPPED_SHADOWS 1100 // iOS 3.2
-#define WEBKIT_FIRST_VERSION_WITHOUT_MULTIPLE_IFRAME_TOUCH_EVENT_DISPATCH 1400 // iOS 4.2
-#define WEBKIT_FIRST_VERSION_WITH_CSS_TRANSFORMS_AFFECTING_OVERFLOW 1600 // iOS 5.0
-#define WEBKIT_FIRST_VERSION_WITH_WINDOW_ON_ERROR 1600 // iOS 5.0
-#define WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY 2239 // iOS 6.0
-#define WEBKIT_FIRST_VERSION_WITH_YOUTUBE_EMBED_IFRAME_TRANSFORM 2239 // iOS 6.0
 #define WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR 2665 // iOS 7.0
 #define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 2665 // iOS 7.0
 #define WEBKIT_FIRST_VERSION_WITH_INSECURE_CONTENT_BLOCKING 3454
index eced122..f94733b 100644 (file)
@@ -1924,21 +1924,7 @@ static BOOL isQuickLookEvent(NSEvent *event)
     if (_private->closed)
         return nil;
 
-#if PLATFORM(IOS)
-    // Preserve <rdar://problem/7992472> behavior for third party applications. See <rdar://problem/8463725>.
-    if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_MULTIPLE_IFRAME_TOUCH_EVENT_DISPATCH)) {
-        WebEvent *event = [WAKWindow currentEvent];
-        if (event != NULL && event.type == WebEventMouseDown && [self mouse:point inRect:[self frame]])
-            return self;
-        NSView *view = [super hitTest:point];
-        
-        // Find the clicked document view
-        while (view && ![view conformsToProtocol:@protocol(WebDocumentView)])
-            view = [view superview];
-            
-        return view;
-    }
-#else
+#if !PLATFORM(IOS)
     BOOL captureHitsOnSubviews;
     if (forceNSViewHitTest)
         captureHitsOnSubviews = NO;
index d0e03f6..4a170a3 100644 (file)
@@ -1222,9 +1222,7 @@ static NSString *leakOutlookQuirksUserScriptContents()
 static bool shouldRespectPriorityInCSSAttributeSetters()
 {
 #if PLATFORM(IOS)
-    static bool isStanzaNeedingAttributeSetterQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY)
-        && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.lexcycle.stanza"];
-    return isStanzaNeedingAttributeSetterQuirk;
+    return false;
 #else
     static bool isIAdProducerNeedingAttributeSetterQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CSS_ATTRIBUTE_SETTERS_IGNORING_PRIORITY)
         && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.iAdProducer"];
@@ -1233,18 +1231,6 @@ static bool shouldRespectPriorityInCSSAttributeSetters()
 }
 
 #if PLATFORM(IOS)
-static bool shouldTransformsAffectOverflow()
-{
-    static bool shouldTransformsAffectOverflow = !IOSApplication::isOkCupid() || WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CSS_TRANSFORMS_AFFECTING_OVERFLOW);
-    return shouldTransformsAffectOverflow;
-}
-
-static bool shouldDispatchJavaScriptWindowOnErrorEvents()
-{
-    static bool shouldDispatchJavaScriptWindowOnErrorEvents = !IOSApplication::isFacebook() || WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_WINDOW_ON_ERROR);
-    return shouldDispatchJavaScriptWindowOnErrorEvents;
-}
-
 static bool isInternalInstall()
 {
     static bool isInternal = MGGetBoolAnswer(kMGQAppleInternalInstallCapability);
@@ -1562,6 +1548,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 
     WebInstallMemoryPressureHandler();
 
+#if !PLATFORM(IOS)
     if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION)) {
         // Originally, we allowed all local loads.
         SecurityPolicy::setLocalLoadPolicy(SecurityPolicy::AllowLocalLoadsForAll);
@@ -1570,6 +1557,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
         // with substitute data.
         SecurityPolicy::setLocalLoadPolicy(SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
     }
+#endif
 
 #if PLATFORM(MAC)
     if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS))
@@ -2910,8 +2898,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
 #if HAVE(AVKIT)
     settings.setAVKitEnabled([preferences avKitEnabled]);
 #endif
-    settings.setShouldTransformsAffectOverflow(shouldTransformsAffectOverflow());
-    settings.setShouldDispatchJavaScriptWindowOnErrorEvents(shouldDispatchJavaScriptWindowOnErrorEvents());
 
     settings.setPasswordEchoEnabled([preferences _allowPasswordEcho]);
     settings.setPasswordEchoDurationInSeconds([preferences _passwordEchoDuration]);
index 8f206e7..8bba15b 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-09  Brady Eidson  <beidson@apple.com>
+
+        Remove some obsolete WebKitVersionChecks.
+        https://bugs.webkit.org/show_bug.cgi?id=174294
+
+        Reviewed by Dan Bernstein.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2017-07-08  Chris Dumez  <cdumez@apple.com>
 
         Simplify WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore
index 51d877b..7692844 100644 (file)
@@ -3271,8 +3271,6 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 
     settings.setEnableInheritURIQueryComponent(store.getBoolValueForKey(WebPreferencesKey::enableInheritURIQueryComponentKey()));
 
-    settings.setShouldDispatchJavaScriptWindowOnErrorEvents(true);
-
     auto userInterfaceDirectionPolicyCandidate = static_cast<WebCore::UserInterfaceDirectionPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::userInterfaceDirectionPolicyKey()));
     if (userInterfaceDirectionPolicyCandidate == WebCore::UserInterfaceDirectionPolicy::Content || userInterfaceDirectionPolicyCandidate == WebCore::UserInterfaceDirectionPolicy::System)
         settings.setUserInterfaceDirectionPolicy(userInterfaceDirectionPolicyCandidate);