Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Sep 2019 18:03:30 +0000 (18:03 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Sep 2019 18:03:30 +0000 (18:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202119
<rdar://problem/55638792>

Reviewed by Alex Christensen.

After refactoring and other code evolution, some platform checks have
ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
vice-versa). These can be converted into the equivalent
PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
check can be removed altogether (along with any "#else" branches).

Source/WebCore:

No new tests -- no new or changed functionality.

* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAppleLegacyCssValueKeyword):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::platform):
* page/FrameView.cpp:
(WebCore::FrameView::updateBackgroundRecursively):
* platform/Timer.cpp:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
* pal/spi/cocoa/NEFilterSourceSPI.h:
* pal/spi/mac/AVFoundationSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Source/WTF:

* wtf/Platform.h:
* wtf/text/TextBreakIterator.h:

Tools:

* DumpRenderTree/AccessibilityTextMarker.h:
* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::setValue):

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

25 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WTF/wtf/text/TextBreakIterator.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
Source/WebCore/PAL/pal/spi/cocoa/NEFilterSourceSPI.h
Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/Timer.cpp
Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityTextMarker.h
Tools/DumpRenderTree/AccessibilityUIElement.cpp

index 5d80734..928e2f5 100644 (file)
@@ -1,3 +1,20 @@
+2019-09-24  Keith Rollin  <krollin@apple.com>
+
+        Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=202119
+        <rdar://problem/55638792>
+
+        Reviewed by Alex Christensen.
+
+        After refactoring and other code evolution, some platform checks have
+        ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
+        vice-versa). These can be converted into the equivalent
+        PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
+        check can be removed altogether (along with any "#else" branches).
+
+        * wtf/Platform.h:
+        * wtf/text/TextBreakIterator.h:
+
 2019-09-21  David Kilzer  <ddkilzer@apple.com>
 
         clang-tidy: Fix unnecessary copy/ref churn of for loop variables in WTF/JavaScriptCore
index 55da236..8f5596e 100644 (file)
 #endif
 #endif
 
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
 #define USE_COREMEDIA 1
 #define USE_VIDEOTOOLBOX 1
 #define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1
 #define HAVE_MEDIA_PLAYER 1
 #endif
 
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
 #define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
 #endif
 
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
 #define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
 #define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
 #endif
 
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
 #define HAVE_AVFOUNDATION_LOADER_DELEGATE 1
 #endif
 
 #define USE_INSERTION_UNDO_GROUPING 1
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 #define HAVE_AVASSETREADER 1
 #endif
 
 #define USE_MEDIATOOLBOX 1
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 #define USE_OS_LOG 1
 #if USE(APPLE_INTERNAL_SDK)
 #define USE_OS_STATE 1
 #endif
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 #define USE_MEDIAREMOTE 1
 #endif
 
 #define HAVE_NSHTTPCOOKIESTORAGE__INITWITHIDENTIFIER_WITH_INACCURATE_NULLABILITY 1
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 #define HAVE_CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE 1
 /* The override isn't needed on iOS family, as the default behavior is to not sniff. */
 /* FIXME: This should probably be enabled on 10.13.2 and newer, not just 10.14 and newer. */
index 6481ed2..b9a4de1 100644 (file)
@@ -26,7 +26,7 @@
 #include <wtf/text/StringView.h>
 #include <wtf/text/icu/TextBreakIteratorICU.h>
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 #include <wtf/text/cf/TextBreakIteratorCF.h>
 #else
 #include <wtf/text/NullTextBreakIterator.h>
@@ -34,7 +34,7 @@
 
 namespace WTF {
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 typedef TextBreakIteratorCF TextBreakIteratorPlatform;
 #else
 typedef NullTextBreakIterator TextBreakIteratorPlatform;
index 6e3e42d..13ccf26 100644 (file)
@@ -1,3 +1,42 @@
+2019-09-24  Keith Rollin  <krollin@apple.com>
+
+        Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=202119
+        <rdar://problem/55638792>
+
+        Reviewed by Alex Christensen.
+
+        After refactoring and other code evolution, some platform checks have
+        ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
+        vice-versa). These can be converted into the equivalent
+        PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
+        check can be removed altogether (along with any "#else" branches).
+
+        No new tests -- no new or changed functionality.
+
+        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
+        (WebCore::subLocality):
+        (WebCore::setSubLocality):
+        (WebCore::subAdministrativeArea):
+        (WebCore::setSubAdministrativeArea):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::isAppleLegacyCssValueKeyword):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaSessionTitle const):
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::platform):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::updateBackgroundRecursively):
+        * platform/Timer.cpp:
+        * platform/cocoa/NetworkExtensionContentFilter.mm:
+        (WebCore::NetworkExtensionContentFilter::initialize):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::displayP3ColorSpaceRef):
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
+
 2019-09-24  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Unflake web-animations/timing-model/animations/updating-the-finished-state.html WPT test
index f713cf2..30622e7 100644 (file)
@@ -42,42 +42,22 @@ namespace WebCore {
 
 static NSString *subLocality(CNPostalAddress *address)
 {
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
     return address.subLocality;
-#else
-    UNUSED_PARAM(address);
-    return nil;
-#endif
 }
 
 static void setSubLocality(CNMutablePostalAddress *address, NSString *subLocality)
 {
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
     address.subLocality = subLocality;
-#else
-    UNUSED_PARAM(address);
-    UNUSED_PARAM(subLocality);
-#endif
 }
 
 static NSString *subAdministrativeArea(CNPostalAddress *address)
 {
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
     return address.subAdministrativeArea;
-#else
-    UNUSED_PARAM(address);
-    return nil;
-#endif
 }
 
 static void setSubAdministrativeArea(CNMutablePostalAddress *address, NSString *subAdministrativeArea)
 {
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
     address.subAdministrativeArea = subAdministrativeArea;
-#else
-    UNUSED_PARAM(address);
-    UNUSED_PARAM(subAdministrativeArea);
-#endif
 }
 
 static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentContact& contact)
index 86582dc..aacf871 100644 (file)
@@ -1,3 +1,21 @@
+2019-09-24  Keith Rollin  <krollin@apple.com>
+
+        Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=202119
+        <rdar://problem/55638792>
+
+        Reviewed by Alex Christensen.
+
+        After refactoring and other code evolution, some platform checks have
+        ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
+        vice-versa). These can be converted into the equivalent
+        PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
+        check can be removed altogether (along with any "#else" branches).
+
+        * pal/spi/cf/CFNetworkSPI.h:
+        * pal/spi/cocoa/NEFilterSourceSPI.h:
+        * pal/spi/mac/AVFoundationSPI.h:
+
 2019-09-20  Keith Rollin  <krollin@apple.com>
 
         Remove some support for < iOS 13
index 553d876..e9dcf50 100644 (file)
@@ -218,7 +218,7 @@ typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) {
 #endif
 @end
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 @interface NSURLSessionTaskTransactionMetrics ()
 @property (copy, readonly) NSString* _remoteAddressAndPort;
 @property (copy, readonly) NSUUID* _connectionIdentifier;
index 9b959e4..f7b019e 100644 (file)
@@ -69,7 +69,7 @@ typedef void (^NEFilterSourceDecisionHandler)(NEFilterSourceStatus, NSDictionary
 - (void)receivedData:(NSData *)data decisionHandler:(NEFilterSourceDecisionHandler)decisionHandler;
 - (void)finishedLoadingWithDecisionHandler:(NEFilterSourceDecisionHandler)decisionHandler;
 - (void)remediateWithDecisionHandler:(NEFilterSourceDecisionHandler)decisionHandler;
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 @property (copy) NSString *sourceAppIdentifier;
 @property (assign) pid_t sourceAppPid;
 #endif
index 1360b68..1af3e61 100644 (file)
 #import <AVFoundation/AVPlayerItem.h>
 #import <AVFoundation/AVPlayerLayer.h>
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 NS_ASSUME_NONNULL_BEGIN
 @interface AVPlayerItem ()
 @property (nonatomic, readonly) NSTimeInterval seekableTimeRangesLastModifiedTime NS_AVAILABLE(10_13, 11_0);
 @property (nonatomic, readonly) NSTimeInterval liveUpdateInterval;
 @end
 NS_ASSUME_NONNULL_END
-#endif // PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#endif // PLATFORM(COCOA)
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) || PLATFORM(IOS_FAMILY)
 
index d32f6b0..f3ec7ac 100644 (file)
@@ -155,14 +155,14 @@ static bool isAppleLegacyCssValueKeyword(const char* valueKeyword, unsigned leng
     static const char appleSystemPrefix[] = "-apple-system";
     static const char applePayPrefix[] = "-apple-pay";
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
     static const char* appleWirelessPlaybackTargetActive = getValueName(CSSValueAppleWirelessPlaybackTargetActive);
 #endif
 
     return hasPrefix(valueKeyword, length, applePrefix)
     && !hasPrefix(valueKeyword, length, appleSystemPrefix)
     && !hasPrefix(valueKeyword, length, applePayPrefix)
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
     && !WTF::equal(reinterpret_cast<const LChar*>(valueKeyword), reinterpret_cast<const LChar*>(appleWirelessPlaybackTargetActive), length)
 #endif
     ;
index c1b9170..6c1195a 100644 (file)
@@ -7637,7 +7637,7 @@ String HTMLMediaElement::mediaSessionTitle() const
         return title;
 
     title = m_currentSrc.host().toString();
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
     if (!title.isEmpty())
         title = decodeHostName(title);
 #endif
index 1d4103d..a0fd765 100644 (file)
@@ -295,7 +295,7 @@ unsigned InspectorFrontendHost::inspectionLevel()
 
 String InspectorFrontendHost::platform()
 {
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
     return "mac"_s;
 #elif OS(WINDOWS)
     return "windows"_s;
index eaf89e3..fea880d 100644 (file)
@@ -2977,7 +2977,7 @@ void FrameView::setBaseBackgroundColor(const Color& backgroundColor)
 void FrameView::updateBackgroundRecursively(const Optional<Color>& backgroundColor)
 {
 #if HAVE(OS_DARK_MODE_SUPPORT)
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
     static const auto cssValueControlBackground = CSSValueAppleSystemControlBackground;
 #else
     static const auto cssValueControlBackground = CSSValueWindow;
index 1c36d53..2b46351 100644 (file)
@@ -37,7 +37,7 @@
 #include <wtf/MainThread.h>
 #include <wtf/Vector.h>
 
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
 #include <wtf/spi/darwin/dyldSPI.h>
 #endif
 
index 71e92b7..b59a1b1 100644 (file)
@@ -70,10 +70,8 @@ void NetworkExtensionContentFilter::initialize(const URL* url)
     m_queue = adoptOSObject(dispatch_queue_create("WebKit NetworkExtension Filtering", DISPATCH_QUEUE_SERIAL));
     ASSERT_UNUSED(url, !url);
     m_neFilterSource = adoptNS([allocNEFilterSourceInstance() initWithDecisionQueue:m_queue.get()]);
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
     [m_neFilterSource setSourceAppIdentifier:applicationBundleIdentifier()];
     [m_neFilterSource setSourceAppPid:presentingApplicationPID()];
-#endif
 }
 
 void NetworkExtensionContentFilter::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
index 1a3ea66..f06fe50 100644 (file)
@@ -125,7 +125,7 @@ CGColorSpaceRef displayP3ColorSpaceRef()
     static CGColorSpaceRef displayP3ColorSpace;
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
         displayP3ColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);
 #else
         displayP3ColorSpace = sRGBColorSpaceRef();
index 2a0e5b7..42bc8e1 100644 (file)
@@ -551,7 +551,7 @@ void GraphicsContext3D::bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsi
     ::glBufferSubData(target, offset, size, data);
 }
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) || PLATFORM(WPE)
+#if PLATFORM(COCOA) || PLATFORM(WPE)
 void* GraphicsContext3D::mapBufferRange(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr length, GC3Dbitfield access)
 {
     makeContextCurrent();
index f949244..9e14181 100644 (file)
@@ -58,7 +58,7 @@
 #include "WebCoreThreadInternal.h"
 #endif
 
-#if PLATFORM(IOS_FAMILY) || PLATFORM(MAC)
+#if PLATFORM(COCOA)
 extern "C" const CFStringRef kCFStreamPropertySourceApplication;
 extern "C" const CFStringRef _kCFStreamSocketSetNoDelay;
 #endif
index be135d8..d71e28f 100644 (file)
@@ -2972,7 +2972,7 @@ bool RenderLayerCompositor::requiresCompositingForScrollableFrame(RequiresCompos
     if (isMainFrameCompositor())
         return false;
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
     if (!m_renderView.settings().asyncFrameScrollingEnabled())
         return false;
 #endif
index 5290e62..896b789 100644 (file)
@@ -1,3 +1,21 @@
+2019-09-24  Keith Rollin  <krollin@apple.com>
+
+        Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=202119
+        <rdar://problem/55638792>
+
+        Reviewed by Alex Christensen.
+
+        After refactoring and other code evolution, some platform checks have
+        ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
+        vice-versa). These can be converted into the equivalent
+        PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
+        check can be removed altogether (along with any "#else" branches).
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
 2019-09-24  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState triggers a debug assertion
index 1c6507d..b069ee3 100644 (file)
@@ -677,10 +677,8 @@ static inline void processServerTrustEvaluation(NetworkSessionCocoa *session, NS
         if (networkDataTask->shouldCaptureExtraNetworkLoadMetrics()) {
             networkLoadMetrics.priority = toNetworkLoadPriority(task.priority);
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
             networkLoadMetrics.remoteAddress = String(m._remoteAddressAndPort);
             networkLoadMetrics.connectionIdentifier = String([m._connectionIdentifier UUIDString]);
-#endif
 
 #if HAVE(CFNETWORK_NEGOTIATED_SSL_PROTOCOL_CIPHER)
             networkLoadMetrics.tlsProtocol = stringForSSLProtocol(m._negotiatedTLSProtocol);
@@ -693,7 +691,6 @@ static inline void processServerTrustEvaluation(NetworkSessionCocoa *session, NS
             }];
             networkLoadMetrics.requestHeaders = WTFMove(requestHeaders);
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
             uint64_t requestHeaderBytesSent = 0;
             uint64_t responseHeaderBytesReceived = 0;
             uint64_t responseBodyBytesReceived = 0;
@@ -711,7 +708,6 @@ static inline void processServerTrustEvaluation(NetworkSessionCocoa *session, NS
             networkLoadMetrics.responseHeaderBytesReceived = responseHeaderBytesReceived;
             networkLoadMetrics.responseBodyBytesReceived = responseBodyBytesReceived;
             networkLoadMetrics.responseBodyDecodedSize = responseBodyDecodedSize;
-#endif
         }
     }
 }
index d916d3c..20e1807 100644 (file)
@@ -239,7 +239,7 @@ private:
             VideoTrigger |
             PluginTrigger|
             CanvasTrigger |
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
             ScrollableNonMainFrameTrigger |
 #endif
 #if PLATFORM(IOS_FAMILY)
index 8a13121..8a76b97 100644 (file)
@@ -1,3 +1,21 @@
+2019-09-24  Keith Rollin  <krollin@apple.com>
+
+        Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=202119
+        <rdar://problem/55638792>
+
+        Reviewed by Alex Christensen.
+
+        After refactoring and other code evolution, some platform checks have
+        ended up looking like PLATFORM(MAC) || PLATFORM(IOS_FAMILY) (or
+        vice-versa). These can be converted into the equivalent
+        PLATFORM(COCOA). Where the instance occurs in a Cocoa-only file, the
+        check can be removed altogether (along with any "#else" branches).
+
+        * DumpRenderTree/AccessibilityTextMarker.h:
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (AccessibilityUIElement::setValue):
+
 2019-09-24  Zhifei Fang  <zhifei_fang@apple.com>
 
         Add tests for Ref.js.
index a34db8c..96e997a 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <JavaScriptCore/JSObjectRef.h>
 
-#if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if PLATFORM(COCOA)
 #define SUPPORTS_AX_TEXTMARKERS 1
 #else
 #define SUPPORTS_AX_TEXTMARKERS 0
index b34b401..2fdcc00 100644 (file)
@@ -1611,7 +1611,7 @@ static JSValueRef mathPrescriptsDescriptionCallback(JSContextRef context, JSObje
 // Implementation
 
 // Unsupported methods on various platforms.
-#if !PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
+#if !PLATFORM(MAC)
 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line) { return 0; }
 JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
 void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
@@ -1622,13 +1622,10 @@ AccessibilityUIElement AccessibilityUIElement::verticalScrollbar() const { retur
 AccessibilityUIElement AccessibilityUIElement::uiElementAttributeValue(JSStringRef) const { return { nullptr }; }
 #endif
 
-#if !PLATFORM(MAC) && !PLATFORM(IOS_FAMILY)
+#if !PLATFORM(COCOA)
 JSRetainPtr<JSStringRef> AccessibilityUIElement::speakAs() { return nullptr; }
 JSRetainPtr<JSStringRef> AccessibilityUIElement::pathDescription() const { return 0; }
 void AccessibilityUIElement::setValue(JSStringRef) { }
-#endif
-
-#if !PLATFORM(COCOA)
 void AccessibilityUIElement::uiElementArrayAttributeValue(JSStringRef, Vector<AccessibilityUIElement>&) const { }
 #endif