Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about...
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 May 2020 01:53:44 +0000 (01:53 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 May 2020 01:53:44 +0000 (01:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211402

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attributesForAttributedStringConversion): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV). Move NSExcludedElementsDocumentAttribute to
AttributedStringSPI.h.

* page/SettingsDefaultValues.h: Rewrite conic gradient conditional to call out
tvOS as an exception rather than doing that indirectly through __IPHONE_OS_VERSION_MIN_REQUIRED.
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint): Ditto.

* platform/graphics/cocoa/FontCacheCoreText.cpp: Rewrite
HAS_CORE_TEXT_WIDTH_ATTRIBUTE to use !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
(WebCore::variationCapabilitiesForFontDescriptor): Ditto.
(WebCore::FontCache::lastResortFallbackFont): Ditto.

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::matchSystemFontUse): Use HAVE(SYSTEM_FONT_STYLE_TITLE_0) and
HAVE(SYSTEM_FONT_STYLE_TITLE_4) instead of __IPHONE_OS_VERSION_MIN_REQUIRED.
This consolidates the watchOS/tvOS issue into the PlatformHave.h file, and
does not change behavior at this time.

* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAttributesDictionary): Changed this to not use
a global since it's only called as part of initializing another global, and
to return a RetainPtr.
(WebCore::cascadeToLastResortAndVariationsFontDescriptor): Removed
WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG after researching to
be sure it's fixed on recent watchOS and tvOS. Also changed this to return
a raw pointer instead of RetainPtr since it returns a single global object.
Also removed the CTFontRef argument.
(WebCore::FontPlatformData::ctFont const): Updated for the changes above.

* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::surfaceID const): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase): Ditto.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData): Ditto.

Source/WebCore/PAL:

* pal/spi/cocoa/NSAttributedStringSPI.h: Moved iOS family version of
NSExcludedElementsDocumentAttribute to this header. For now didn't
change its implementation to match, just moved it as is.

Source/WebKit:

* NetworkProcess/NetworkActivityTracker.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(APPLETV). There was already an explicit watchOS case here.

* Platform/spi/ios/UIKitSPI.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
PLATFORM(IOS) in one place, and in the other removed the conditional entirely.
THe one place here that does PLATFORM(IOS) is for a property that is not on
watchOS and tvOS at this time, related to dragging. Decided not to add a comment
about it.

* Shared/WebPreferencesDefaultValues.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(APPLETV). There was already an explicit watchOS case here.

* UIProcess/API/ios/WKWebViewIOS.mm:
(contentOffsetBoundedInValidRange): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
(-[WKWebView activeViewLayoutSize:]): Ditto.
(-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): Ditto.
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
(-[WKChildScrollView initWithFrame:]): Ditto.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): Ditto.
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Ditto.
* UIProcess/ios/WKScrollView.h: Ditto.
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]): Ditto.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.mm:
(attributesForAttributedStringConversion): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to PLATFORM(WATCHOS) || PLATFORM(APPLETV).

* WebView/WebUIDelegatePrivate.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
TARGET_OS_IOS for a method that is based on dragging concepts not present in
watchOS and tvOS.

* WebView/WebView.mm: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
to PLATFORM(IOS).

* WebView/WebViewPrivate.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
TARGET_OS_IOS.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
Remove unneeded __IPHONE_OS_VERSION_MIN_REQUIRED check.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
!PLATFORM(WATCHOS) && !PLATFORM(APPLETV).

* TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
PLATFORM(IOS).

* TestWebKitAPI/Tests/ios/OverflowScrollViewTests.mm:
Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
!PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView setOverrideSafeAreaInsets:]): Ditto.

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

33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/NSAttributedStringSPI.h
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/page/SettingsDefaultValues.h
Source/WebCore/platform/graphics/cg/GradientCG.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkActivityTracker.h
Source/WebKit/Platform/spi/ios/UIKitSPI.h
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WKScrollView.h
Source/WebKit/UIProcess/ios/WKScrollView.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebUIDelegatePrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewPrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm
Tools/TestWebKitAPI/Tests/ios/OverflowScrollViewTests.mm
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm

index d46a1ca..84fb9e8 100644 (file)
@@ -1,5 +1,52 @@
 2020-05-04  Darin Adler  <darin@apple.com>
 
+        Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
+        https://bugs.webkit.org/show_bug.cgi?id=211402
+
+        Reviewed by Alexey Proskuryakov.
+
+        * editing/cocoa/WebContentReaderCocoa.mm:
+        (WebCore::attributesForAttributedStringConversion): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV). Move NSExcludedElementsDocumentAttribute to
+        AttributedStringSPI.h.
+
+        * page/SettingsDefaultValues.h: Rewrite conic gradient conditional to call out
+        tvOS as an exception rather than doing that indirectly through __IPHONE_OS_VERSION_MIN_REQUIRED.
+        * platform/graphics/cg/GradientCG.cpp:
+        (WebCore::Gradient::paint): Ditto.
+
+        * platform/graphics/cocoa/FontCacheCoreText.cpp: Rewrite
+        HAS_CORE_TEXT_WIDTH_ATTRIBUTE to use !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
+        (WebCore::variationCapabilitiesForFontDescriptor): Ditto.
+        (WebCore::FontCache::lastResortFallbackFont): Ditto.
+
+        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
+        (WebCore::matchSystemFontUse): Use HAVE(SYSTEM_FONT_STYLE_TITLE_0) and
+        HAVE(SYSTEM_FONT_STYLE_TITLE_4) instead of __IPHONE_OS_VERSION_MIN_REQUIRED.
+        This consolidates the watchOS/tvOS issue into the PlatformHave.h file, and
+        does not change behavior at this time.
+
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::cascadeToLastResortAttributesDictionary): Changed this to not use
+        a global since it's only called as part of initializing another global, and
+        to return a RetainPtr.
+        (WebCore::cascadeToLastResortAndVariationsFontDescriptor): Removed
+        WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG after researching to
+        be sure it's fixed on recent watchOS and tvOS. Also changed this to return
+        a raw pointer instead of RetainPtr since it returns a single global object.
+        Also removed the CTFontRef argument.
+        (WebCore::FontPlatformData::ctFont const): Updated for the changes above.
+
+        * platform/graphics/cocoa/IOSurface.mm:
+        (WebCore::IOSurface::surfaceID const): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::platformFontWithFamilySpecialCase): Ditto.
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::createFontCustomPlatformData): Ditto.
+
+2020-05-04  Darin Adler  <darin@apple.com>
+
         Remove HAVE(IOSURFACE) checks in Cocoa-platform-specific code
         https://bugs.webkit.org/show_bug.cgi?id=211389
 
index 9a35f88..59a824a 100644 (file)
@@ -1,3 +1,14 @@
+2020-05-04  Darin Adler  <darin@apple.com>
+
+        Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
+        https://bugs.webkit.org/show_bug.cgi?id=211402
+
+        Reviewed by Alexey Proskuryakov.
+
+        * pal/spi/cocoa/NSAttributedStringSPI.h: Moved iOS family version of
+        NSExcludedElementsDocumentAttribute to this header. For now didn't
+        change its implementation to match, just moved it as is.
+
 2020-05-04  Peng Liu  <peng.liu6@apple.com>
 
         Fix the mistake on macro HAVE_SYSTEM_FEATURE_FLAGS
index c64a6ee..ad156ff 100644 (file)
@@ -101,6 +101,8 @@ SOFT_LINK_CONSTANT(UIFoundation, NSTextAlternativesAttributeName, NSString *)
 // will continue to support it.
 static NSString *const NSSuperscriptAttributeName = @"NSSuperscript";
 
+static NSString *const NSExcludedElementsDocumentAttribute = @"ExcludedElements";
+
 @interface NSAttributedString ()
 - (id)initWithRTF:(NSData *)data documentAttributes:(NSDictionary **)dict;
 - (id)initWithRTFD:(NSData *)data documentAttributes:(NSDictionary **)dict;
@@ -109,9 +111,6 @@ static NSString *const NSSuperscriptAttributeName = @"NSSuperscript";
 - (BOOL)containsAttachments;
 @end
 
-#endif // PLATFORM(IOS_FAMILY)
-
-#if PLATFORM(IOS_FAMILY)
 static NSString *const NSTextListMarkerCircle = @"{circle}";
 static NSString *const NSTextListMarkerDisc = @"{disc}";
 static NSString *const NSTextListMarkerSquare = @"{square}";
@@ -125,4 +124,5 @@ static NSString *const NSTextListMarkerUppercaseLatin = @"{upper-latin}";
 static NSString *const NSTextListMarkerLowercaseRoman = @"{lower-roman}";
 static NSString *const NSTextListMarkerUppercaseRoman = @"{upper-roman}";
 static NSString *const NSTextListMarkerDecimal = @"{decimal}";
+
 #endif // PLATFORM(IOS_FAMILY)
index d794784..2899f35 100644 (file)
 #import "LocalDefaultSystemAppearance.h"
 #endif
 
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(MAC)
+// FIXME: Do we really need to keep the legacy code path around for watchOS and tvOS?
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 @interface NSAttributedString ()
-- (NSString *)_htmlDocumentFragmentString:(NSRange)range documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources;
+- (NSString *)_htmlDocumentFragmentString:(NSRange)range documentAttributes:(NSDictionary *)attributes subresources:(NSArray **)subresources;
 @end
-#elif PLATFORM(IOS_FAMILY)
+#else
 SOFT_LINK_PRIVATE_FRAMEWORK(WebKitLegacy)
-#elif PLATFORM(MAC)
-SOFT_LINK_FRAMEWORK_IN_UMBRELLA(WebKit, WebKitLegacy)
-#endif
-
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
 SOFT_LINK(WebKitLegacy, _WebCreateFragment, void, (WebCore::Document& document, NSAttributedString *string, WebCore::FragmentAndResources& result), (document, string, result))
 #endif
 
@@ -96,7 +92,7 @@ static FragmentAndResources createFragment(Frame&, NSAttributedString *)
     return { };
 }
 
-#elif (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(MAC)
+#elif !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 
 static NSDictionary *attributesForAttributedStringConversion()
 {
@@ -121,10 +117,6 @@ static NSDictionary *attributesForAttributedStringConversion()
         [excludedElements addObject:@"object"];
 #endif
 
-#if PLATFORM(IOS_FAMILY)
-    static NSString * const NSExcludedElementsDocumentAttribute = @"ExcludedElements";
-#endif
-
     NSURL *baseURL = URL::fakeURLWithRelativePart(emptyString());
 
     // The output base URL needs +1 refcount to work around the fact that NSHTMLReader over-releases it.
@@ -163,6 +155,7 @@ static FragmentAndResources createFragment(Frame& frame, NSAttributedString *str
 
 #else
 
+// FIXME: Do we really need to keep this legacy code path around for watchOS and tvOS?
 static FragmentAndResources createFragment(Frame& frame, NSAttributedString *string)
 {
     FragmentAndResources result;
index 7084a6a..886385b 100644 (file)
@@ -103,8 +103,10 @@ static const bool defaultMediaEnabled = true;
 #else
 static const bool defaultMediaEnabled = false;
 #endif
-    
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(WATCHOS)
+
+// FIXME: Seems like this should be HAVE(CG_CONTEXT_DRAW_CONIC_GRADIENT).
+// FIXME: Can we change tvOS to be like the other Cocoa platforms?
+#if PLATFORM(COCOA) && !PLATFORM(APPLETV)
 static const bool defaultConicGradient = true;
 #else
 static const bool defaultConicGradient = false;
index add7d39..deeb91f 100644 (file)
@@ -182,7 +182,9 @@ void Gradient::paint(CGContextRef platformContext)
                 CGContextRestoreGState(platformContext);
         },
         [&] (const ConicData& data) {
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(WATCHOS)
+// FIXME: Seems like this should be HAVE(CG_CONTEXT_DRAW_CONIC_GRADIENT).
+// FIXME: Can we change tvOS to be like the other Cocoa platforms?
+#if PLATFORM(COCOA) && !PLATFORM(APPLETV)
             CGContextSaveGState(platformContext);
             CGContextTranslateCTM(platformContext, data.point0.x(), data.point0.y());
             CGContextRotateCTM(platformContext, (CGFloat)-M_PI_2);
index 332d2ef..b375393 100644 (file)
@@ -39,7 +39,9 @@
 #include <wtf/MemoryPressureHandler.h>
 #include <wtf/NeverDestroyed.h>
 
-#define HAS_CORE_TEXT_WIDTH_ATTRIBUTE (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000))
+// FIXME: This seems like it should be in PlatformHave.h.
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#define HAS_CORE_TEXT_WIDTH_ATTRIBUTE (PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV))
 
 namespace WebCore {
 
@@ -1064,7 +1066,8 @@ static VariationCapabilities variationCapabilitiesForFontDescriptor(CTFontDescri
     }
 
     bool optOutFromGXNormalization = false;
-#if (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000))
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     optOutFromGXNormalization = CTFontDescriptorIsSystemUIFont(fontDescriptor);
 #endif
 
@@ -1642,7 +1645,8 @@ Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescripti
         return *result;
 
     // LastResort is guaranteed to be non-null.
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(MAC)
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     auto fontDescriptor = adoptCF(CTFontDescriptorCreateLastResort());
     auto font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), fontDescription.computedPixelSize(), nullptr));
 #else
index 31c67e9..abc59a4 100644 (file)
@@ -82,8 +82,10 @@ static inline Optional<SystemFontKind> matchSystemFontUse(const AtomString& stri
         kCTUIFontTextStyleShortFootnote,
         kCTUIFontTextStyleShortCaption1,
         kCTUIFontTextStyleTallBody,
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if HAVE(SYSTEM_FONT_STYLE_TITLE_0)
         kCTUIFontTextStyleTitle0,
+#endif
+#if HAVE(SYSTEM_FONT_STYLE_TITLE_4)
         kCTUIFontTextStyleTitle4,
 #endif
     };
index 4889e13..8a639db 100644 (file)
@@ -103,50 +103,22 @@ inline int mapFontWidthVariantToCTFeatureSelector(FontWidthVariant variant)
     return TextSpacingProportional;
 }
 
-static CFDictionaryRef cascadeToLastResortAttributesDictionary()
+static RetainPtr<CFDictionaryRef> cascadeToLastResortAttributesDictionary()
 {
-    static CFDictionaryRef attributes = nullptr;
-    if (attributes)
-        return attributes;
-
-    RetainPtr<CTFontDescriptorRef> lastResort = adoptCF(CTFontDescriptorCreateWithNameAndSize(CFSTR("LastResort"), 0));
+    auto lastResort = adoptCF(CTFontDescriptorCreateWithNameAndSize(CFSTR("LastResort"), 0));
 
     CFTypeRef descriptors[] = { lastResort.get() };
     RetainPtr<CFArrayRef> array = adoptCF(CFArrayCreate(kCFAllocatorDefault, descriptors, WTF_ARRAY_LENGTH(descriptors), &kCFTypeArrayCallBacks));
 
     CFTypeRef keys[] = { kCTFontCascadeListAttribute };
     CFTypeRef values[] = { array.get() };
-    attributes = CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-
-    return attributes;
+    return adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
 }
 
-static RetainPtr<CTFontDescriptorRef> cascadeToLastResortAndVariationsFontDescriptor(CTFontRef originalFont)
+static CTFontDescriptorRef cascadeToLastResortAndVariationsFontDescriptor()
 {
-// FIXME: Remove this when <rdar://problem/28449441> is fixed. NOTE: That radar was fixed 11/16/16, so this can be removed. TBD.
-#define WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG (ENABLE(VARIATION_FONTS) && (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000))
-
-    CFDictionaryRef attributes = cascadeToLastResortAttributesDictionary();
-#if WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG
-    auto variations = adoptCF(static_cast<CFDictionaryRef>(CTFontCopyAttribute(originalFont, kCTFontVariationAttribute)));
-    if (!variations || !CFDictionaryGetCount(variations.get()) || CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(originalFont)).get()))
-#endif
-    {
-        UNUSED_PARAM(originalFont);
-
-        static CTFontDescriptorRef descriptor = nullptr;
-        if (descriptor)
-            return descriptor;
-
-        descriptor = CTFontDescriptorCreateWithAttributes(attributes);
-        return descriptor;
-    }
-#if WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG
-    auto mutableAttributes = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, attributes));
-    CFDictionaryAddValue(mutableAttributes.get(), kCTFontVariationAttribute, variations.get());
-    return adoptCF(CTFontDescriptorCreateWithAttributes(mutableAttributes.get()));
-#endif
-#undef WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG
+    static CTFontDescriptorRef descriptor = CTFontDescriptorCreateWithAttributes(cascadeToLastResortAttributesDictionary().get());
+    return descriptor;
 }
 
 CTFontRef FontPlatformData::ctFont() const
@@ -155,7 +127,7 @@ CTFontRef FontPlatformData::ctFont() const
         return m_ctFont.get();
 
     ASSERT(m_font);
-    m_ctFont = adoptCF(CTFontCreateCopyWithAttributes(m_font.get(), m_size, nullptr, cascadeToLastResortAndVariationsFontDescriptor(m_font.get()).get()));
+    m_ctFont = adoptCF(CTFontCreateCopyWithAttributes(m_font.get(), m_size, nullptr, cascadeToLastResortAndVariationsFontDescriptor()));
 
     if (m_widthVariant != FontWidthVariant::RegularWidth) {
         int featureTypeValue = kTextSpacingType;
index ac6b1e1..91b141a 100644 (file)
@@ -375,7 +375,9 @@ IOSurface::Format IOSurface::format() const
 
 IOSurfaceID IOSurface::surfaceID() const
 {
-#if PLATFORM(IOS_FAMILY) && (!USE(APPLE_INTERNAL_SDK) || __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
+// FIXME: Should be able to do this even without the Apple internal SDK.
+// FIXME: Should be able to do this on watchOS and tvOS.
+#if PLATFORM(IOS_FAMILY) && (!USE(APPLE_INTERNAL_SDK) || PLATFORM(WATCHOS) || PLATFORM(APPLETV))
     return 0;
 #else
     return IOSurfaceGetID(m_surface.get());
index 2b2ac8a..ed1bdc8 100644 (file)
@@ -156,7 +156,8 @@ RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family,
     }
 
     if (equalLettersIgnoringASCIICase(family, "lastresort")) {
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
         static const CTFontDescriptorRef lastResort = CTFontDescriptorCreateLastResort();
         return adoptCF(CTFontCreateWithFontDescriptor(lastResort, size, nullptr));
 #else
index 219a995..8c46153 100644 (file)
@@ -56,7 +56,8 @@ std::unique_ptr<FontCustomPlatformData> createFontCustomPlatformData(SharedBuffe
     RetainPtr<CFDataRef> bufferData = buffer.createCFData();
 
     RetainPtr<CTFontDescriptorRef> fontDescriptor;
-#if PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     auto array = adoptCF(CTFontManagerCreateFontDescriptorsFromData(bufferData.get()));
     if (!array)
         return nullptr;
index 2630fa5..60201f3 100644 (file)
@@ -1,3 +1,36 @@
+2020-05-04  Darin Adler  <darin@apple.com>
+
+        Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
+        https://bugs.webkit.org/show_bug.cgi?id=211402
+
+        Reviewed by Alexey Proskuryakov.
+
+        * NetworkProcess/NetworkActivityTracker.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to !PLATFORM(APPLETV). There was already an explicit watchOS case here.
+
+        * Platform/spi/ios/UIKitSPI.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
+        PLATFORM(IOS) in one place, and in the other removed the conditional entirely.
+        THe one place here that does PLATFORM(IOS) is for a property that is not on
+        watchOS and tvOS at this time, related to dragging. Decided not to add a comment
+        about it.
+
+        * Shared/WebPreferencesDefaultValues.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to !PLATFORM(APPLETV). There was already an explicit watchOS case here.
+
+        * UIProcess/API/ios/WKWebViewIOS.mm:
+        (contentOffsetBoundedInValidRange): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
+        (-[WKWebView activeViewLayoutSize:]): Ditto.
+        (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): Ditto.
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+        (-[WKChildScrollView initWithFrame:]): Ditto.
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): Ditto.
+        (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Ditto.
+        * UIProcess/ios/WKScrollView.h: Ditto.
+        * UIProcess/ios/WKScrollView.mm:
+        (-[WKScrollView initWithFrame:]): Ditto.
+
 2020-05-04  Peng Liu  <peng.liu6@apple.com>
 
         Fix the mistake on macro HAVE_SYSTEM_FEATURE_FLAGS
index 288d1d0..f04b102 100644 (file)
 
 #pragma once
 
-#if USE(APPLE_INTERNAL_SDK) && ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || PLATFORM(WATCHOS))
+// FIXME: This should be in PlatformHave.h instead of here.
+// FIXME: Should be able to do this even without the Apple internal SDK.
+// FIXME: Is it correct to that we do not have this on tvOS?
+#if USE(APPLE_INTERNAL_SDK) && PLATFORM(COCOA) && !PLATFORM(APPLETV)
 #define HAVE_NW_ACTIVITY 1
 #endif
 
index 57591d0..47b7f4e 100644 (file)
@@ -515,7 +515,7 @@ typedef enum {
 @property (readonly) NSString *_hostApplicationBundleIdentifier;
 @end
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if PLATFORM(IOS)
 @interface NSURL ()
 @property (nonatomic, copy, setter=_setTitle:) NSString *_title;
 @end
@@ -778,13 +778,11 @@ struct _UIWebTouchPoint {
     CGPoint locationInDocumentCoordinates;
     unsigned identifier;
     UITouchPhase phase;
-#if __IPHONE_OS_VERSION_MIN_REQUIRED > 100000
     CGFloat majorRadiusInScreenCoordinates;
     CGFloat force;
     CGFloat altitudeAngle;
     CGFloat azimuthAngle;
     UIWebTouchPointType touchType;
-#endif
 };
 
 struct _UIWebTouchEvent {
index 2955a09..2bd824c 100644 (file)
 #define DEFAULT_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION_ENABLED false
 #endif
 
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(WATCHOS)
+// FIXME: Seems like this should be HAVE(CG_CONTEXT_DRAW_CONIC_GRADIENT).
+// FIXME: Can we change tvOS to be like the other Cocoa platforms?
+#if PLATFORM(COCOA) && !PLATFORM(APPLETV)
 #define DEFAULT_CONIC_GRADIENT_ENABLED true
 #else
 #define DEFAULT_CONIC_GRADIENT_ENABLED false
index 61c4f42..d165353 100644 (file)
@@ -714,7 +714,8 @@ static WebCore::Color scrollViewBackgroundColor(WKWebView *webView)
 
 static CGPoint contentOffsetBoundedInValidRange(UIScrollView *scrollView, CGPoint contentOffset)
 {
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     UIEdgeInsets contentInsets = scrollView.adjustedContentInset;
 #else
     UIEdgeInsets contentInsets = scrollView.contentInset;
@@ -1709,7 +1710,8 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
     if (_viewLayoutSizeOverride)
         return WebCore::FloatSize(_viewLayoutSizeOverride.value());
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     return WebCore::FloatSize(UIEdgeInsetsInsetRect(CGRectMake(0, 0, bounds.size.width, bounds.size.height), self._scrollViewSystemContentInset).size);
 #else
     return WebCore::FloatSize { bounds.size };
@@ -1789,7 +1791,8 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
     return !pointsEqualInDevicePixels(contentOffset, boundedOffset, deviceScaleFactor);
 }
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 - (void)safeAreaInsetsDidChange
 {
     [super safeAreaInsetsDidChange];
@@ -2312,7 +2315,8 @@ static int32_t activeOrientation(WKWebView *webView)
 
 - (void)_updateScrollViewInsetAdjustmentBehavior
 {
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     if (![_scrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden])
         [_scrollView _setContentInsetAdjustmentBehaviorInternal:self._safeAreaShouldAffectObscuredInsets ? UIScrollViewContentInsetAdjustmentAlways : UIScrollViewContentInsetAdjustmentNever];
 #endif
index 03793dd..69f1fc1 100644 (file)
@@ -384,7 +384,8 @@ static Class scrollViewScrollIndicatorClass()
     if (!self)
         return nil;
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
 #endif
 
index ec183ec..d0212e5 100644 (file)
@@ -2010,7 +2010,8 @@ static BOOL isBuiltInScrollViewGestureRecognizer(UIGestureRecognizer *recognizer
 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)preventedGestureRecognizer canBePreventedByGestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer {
     // Don't allow the highlight to be prevented by a selection gesture. Press-and-hold on a link should highlight the link, not select it.
     bool isForcePressGesture = NO;
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     isForcePressGesture = (preventingGestureRecognizer == _textInteractionAssistant.get().forcePressGesture);
 #endif
 #if PLATFORM(MACCATALYST)
@@ -6664,7 +6665,8 @@ static BOOL allPasteboardItemOriginsMatchOrigin(UIPasteboard *pasteboard, const
 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)routeSharingPolicy routingContextUID:(NSString *)routingContextUID
 {
 #if ENABLE(AIRPLAY_PICKER)
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     if (!_airPlayRoutePicker)
         _airPlayRoutePicker = adoptNS([[WKAirPlayRoutePicker alloc] init]);
     [_airPlayRoutePicker showFromView:self routeSharingPolicy:routeSharingPolicy routingContextUID:routingContextUID hasVideo:hasVideo];
@@ -6880,7 +6882,8 @@ static BOOL allPasteboardItemOriginsMatchOrigin(UIPasteboard *pasteboard, const
     return NO;
 }
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 - (CGRect)unoccludedWindowBoundsForActionSheetAssistant:(WKActionSheetAssistant *)assistant
 {
     UIEdgeInsets contentInset = [[_webView scrollView] adjustedContentInset];
index 4090864..ee1690b 100644 (file)
@@ -37,7 +37,8 @@
 - (void)_setScrollEnabledInternal:(BOOL)enabled;
 - (void)_setZoomEnabledInternal:(BOOL)enabled;
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 @property (nonatomic, assign, readonly) BOOL _contentInsetAdjustmentBehaviorWasExternallyOverridden;
 - (void)_setContentInsetAdjustmentBehaviorInternal:(UIScrollViewContentInsetAdjustmentBehavior)insetAdjustmentBehavior;
 #endif
index 6aef2b3..1d30be4 100644 (file)
@@ -127,7 +127,8 @@ static BOOL shouldForwardScrollViewDelegateMethodToExternalDelegate(SEL selector
     WeakObjCPtr<id <UIScrollViewDelegate>> _externalDelegate;
     WKScrollViewDelegateForwarder *_delegateForwarder;
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     BOOL _contentInsetAdjustmentBehaviorWasExternallyOverridden;
 #endif
     CGFloat _keyboardBottomInsetAdjustment;
@@ -153,7 +154,8 @@ static BOOL shouldForwardScrollViewDelegateMethodToExternalDelegate(SEL selector
     self.directionalLockEnabled = YES;
     [self _setIndicatorInsetAdjustmentBehavior:UIScrollViewIndicatorInsetAdjustmentAlways];
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     _contentInsetAdjustmentBehaviorWasExternallyOverridden = (self.contentInsetAdjustmentBehavior != UIScrollViewContentInsetAdjustmentAutomatic);
 #endif
     
@@ -278,7 +280,8 @@ static inline bool valuesAreWithinOnePixel(CGFloat a, CGFloat b)
     [_internalDelegate _scheduleVisibleContentRectUpdate];
 }
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 
 - (BOOL)_contentInsetAdjustmentBehaviorWasExternallyOverridden
 {
index 021c197..53bfdb8 100644 (file)
@@ -1,3 +1,24 @@
+2020-05-04  Darin Adler  <darin@apple.com>
+
+        Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
+        https://bugs.webkit.org/show_bug.cgi?id=211402
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCoreSupport/WebEditorClient.mm:
+        (attributesForAttributedStringConversion): Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to PLATFORM(WATCHOS) || PLATFORM(APPLETV).
+
+        * WebView/WebUIDelegatePrivate.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
+        TARGET_OS_IOS for a method that is based on dragging concepts not present in
+        watchOS and tvOS.
+
+        * WebView/WebView.mm: Move from __IPHONE_OS_VERSION_MIN_REQUIRED
+        to PLATFORM(IOS).
+
+        * WebView/WebViewPrivate.h: Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
+        TARGET_OS_IOS.
+
 2020-05-04  Emilio Cobos Ãlvarez  <emilio@crisal.io>
 
         Put lh / rlh units behind a flag until bug 211351 is sorted out.
index 0427aac..4c218cd 100644 (file)
@@ -79,6 +79,7 @@
 #import <WebCore/VisibleUnits.h>
 #import <WebCore/WebContentReader.h>
 #import <WebCore/WebCoreObjCExtras.h>
+#import <pal/spi/cocoa/NSAttributedStringSPI.h>
 #import <pal/spi/mac/NSSpellCheckerSPI.h>
 #import <wtf/MainThread.h>
 #import <wtf/RefPtr.h>
@@ -103,7 +104,8 @@ using namespace HTMLNames;
 @end
 #endif
 
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000)
+// FIXME: Seems likely we can get rid of this legacy code for watchOS and tvOS.
+#if PLATFORM(WATCHOS) || PLATFORM(APPLETV)
 @interface NSAttributedString (WebNSAttributedStringDetails)
 - (DOMDocumentFragment *)_documentFromRange:(NSRange)range document:(DOMDocument *)document documentAttributes:(NSDictionary *)attributes subresources:(NSArray **)subresources;
 @end
@@ -419,7 +421,8 @@ void WebEditorClient::getClientPasteboardDataForRange(WebCore::Range*, Vector<St
     // Not implemented WebKit, only WebKit2.
 }
 
-#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(MAC)
+// FIXME: Seems likely we can get rid of this legacy code for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 
 // FIXME: Remove both this stub and the real version of this function below once we don't need the real version on any supported platform.
 // This stub is not used outside WebKit, but it's here so we won't get a linker error.
@@ -454,10 +457,6 @@ static NSDictionary *attributesForAttributedStringConversion()
         [excludedElements addObject:@"object"];
 #endif
 
-#if PLATFORM(IOS_FAMILY)
-    static NSString * const NSExcludedElementsDocumentAttribute = @"ExcludedElements";
-#endif
-
     NSDictionary *dictionary = @{ NSExcludedElementsDocumentAttribute: excludedElements };
 
     [excludedElements release];
index 1534e6f..ee5a65e 100644 (file)
 #import <dlfcn.h>
 #import <limits>
 #import <pal/spi/cf/CFUtilitiesSPI.h>
+#import <pal/spi/cocoa/NSAttributedStringSPI.h>
 #import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
 #import <pal/spi/mac/NSScrollerImpSPI.h>
 #import <pal/spi/mac/NSSpellCheckerSPI.h>
index a0e7161..9b2953f 100644 (file)
@@ -45,7 +45,7 @@
 #endif
 #endif
 
-#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if TARGET_OS_IOS
 @protocol UIDropSession;
 #endif
 
@@ -298,8 +298,9 @@ extern NSString *WebConsoleMessageErrorMessageLevel;
 - (void)webViewSupportedOrientationsUpdated:(WebView *)sender;
 
 - (BOOL)webViewCanCheckGeolocationAuthorizationStatus:(WebView *)sender;
+#endif
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if TARGET_OS_IOS
 /*!
  @method webView:dragDestinationActionMaskForSession:
  @param sender The WebView sending the delegate method
@@ -308,7 +309,6 @@ extern NSString *WebConsoleMessageErrorMessageLevel;
  */
 - (WebDragDestinationAction)webView:(WebView *)sender dragDestinationActionMaskForSession:(id <UIDropSession>)session;
 #endif
-#endif
 
 - (NSData *)webCryptoMasterKeyForWebView:(WebView *)sender;
 
index d4fa832..d68e64f 100644 (file)
@@ -1969,7 +1969,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     }
 }
 
-#elif __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#elif PLATFORM(IOS)
 
 - (BOOL)_requestStartDataInteraction:(CGPoint)clientPosition globalPosition:(CGPoint)globalPosition
 {
@@ -2039,6 +2039,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 }
 
 #endif
+
 #endif // PLATFORM(IOS_FAMILY)
 
 static NSMutableSet *knownPluginMIMETypes()
index 531c810..0ee289b 100644 (file)
@@ -117,7 +117,7 @@ extern NSString *WebQuickLookFileNameKey;
 extern NSString *WebQuickLookUTIKey;
 #endif
 
-#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if TARGET_OS_IOS
 @protocol UIDropSession;
 #endif
 
@@ -479,7 +479,7 @@ Could be worth adding to the API.
 
 - (void)_replaceCurrentHistoryItem:(WebHistoryItem *)item;
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+#if TARGET_OS_IOS
 - (BOOL)_requestStartDataInteraction:(CGPoint)clientPosition globalPosition:(CGPoint)globalPosition;
 - (WebUITextIndicatorData *)_getDataInteractionData;
 @property (nonatomic, readonly, strong, getter=_dataOperationTextIndicator) WebUITextIndicatorData *dataOperationTextIndicator;
index 39e7c47..94bc890 100644 (file)
@@ -1,5 +1,29 @@
 2020-05-04  Darin Adler  <darin@apple.com>
 
+        Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS
+        https://bugs.webkit.org/show_bug.cgi?id=211402
+
+        Reviewed by Alexey Proskuryakov.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/DataDetection.mm:
+        Remove unneeded __IPHONE_OS_VERSION_MIN_REQUIRED check.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
+        Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
+        !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
+        Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
+        PLATFORM(IOS).
+
+        * TestWebKitAPI/Tests/ios/OverflowScrollViewTests.mm:
+        Move from __IPHONE_OS_VERSION_MIN_REQUIRED to
+        !PLATFORM(WATCHOS) && !PLATFORM(APPLETV).
+        * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+        (-[TestRunnerWKWebView setOverrideSafeAreaInsets:]): Ditto.
+
+2020-05-04  Darin Adler  <darin@apple.com>
+
         [Cocoa] Remove a few unneeded __IPHONE_OS_VERSION_MIN_REQUIRED checks
         https://bugs.webkit.org/show_bug.cgi?id=211383
 
index 0b91127..7d4a237 100644 (file)
@@ -146,11 +146,9 @@ TEST(WebKit, AddAndRemoveDataDetectors)
         EXPECT_WK_STREQ("FlightInformation", results[2].type);
         EXPECT_WK_STREQ("AC780", results[2].value);
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
         EXPECT_EQ(DDResultCategoryUnknown, results[0].category);
         EXPECT_EQ(DDResultCategoryCalendarEvent, results[1].category);
         EXPECT_EQ(DDResultCategoryMisc, results[2].category);
-#endif
     };
 
     [webView synchronouslyDetectDataWithTypes:WKDataDetectorTypeAll];
index c44f0da..433a952 100644 (file)
@@ -69,7 +69,7 @@ SOFT_LINK_CLASS(MapKit, MKPlacemark)
 }
 @end
 
-#define USES_MODERN_ATTRIBUTED_STRING_CONVERSION ((PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(MAC))
+#define USES_MODERN_ATTRIBUTED_STRING_CONVERSION (!PLATFORM(WATCHOS) && !PLATFORM(APPLETV))
 
 @interface AttachmentUpdateObserver : NSObject <WKUIDelegatePrivate>
 @property (nonatomic, readonly) NSArray *inserted;
index a464951..6f7f0ca 100644 (file)
@@ -348,7 +348,8 @@ TEST(WKHTTPCookieStore, HttpOnly)
     [cookies release];
 }
 
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
+// FIXME: Would be good to enable this test for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 TEST(WKHTTPCookieStore, CreationTime)
 {   
     auto dataStore = [WKWebsiteDataStore defaultDataStore];
@@ -402,7 +403,7 @@ TEST(WKHTTPCookieStore, CreationTime)
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 }
-#endif // (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
+#endif
 
 // FIXME: This #if should be removed once <rdar://problem/35344202> is resolved and bots are updated.
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED <= 101301
index 719625e..246451b 100644 (file)
@@ -34,7 +34,8 @@
 #import "UIKitSPI.h"
 #import <WebKit/WKWebViewPrivate.h>
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 static NSString *const UIScrollViewIndicatorClass = @"_UIScrollViewScrollIndicator";
 #else
 static NSString *const UIScrollViewIndicatorClass = @"UIImageView";
index b48d12f..1fe54b3 100644 (file)
@@ -481,7 +481,9 @@ IGNORE_WARNINGS_END
 - (void)setOverrideSafeAreaInsets:(UIEdgeInsets)insets
 {
     _overrideSafeAreaInsets = insets;
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+
+// FIXME: Likely we can remove this special case for watchOS and tvOS.
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
     [self _updateSafeAreaInsets];
 #endif
 }