[webkit-changes] [WebKit/WebKit] b5e464: Remove respondsToSelector checks from where they a...

AtariDreams noreply at github.com
Sun Jul 23 13:17:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b5e4644abe94ff8a2991e7a9ceec14e2df43b6f7
      https://github.com/WebKit/WebKit/commit/b5e4644abe94ff8a2991e7a9ceec14e2df43b6f7
  Author: Rose <83477269+AtariDreams at users.noreply.github.com>
  Date:   2023-07-23 (Sun, 23 Jul 2023)

  Changed paths:
    M Source/WTF/wtf/PlatformHave.h
    M Source/WebCore/bridge/objc/objc_instance.mm
    M Source/WebCore/editing/cocoa/HTMLConverter.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    M Source/WebCore/platform/network/cocoa/CookieCocoa.mm
    M Source/WebKit/Platform/cocoa/ImageAnalysisUtilities.mm
    M Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
    M Source/WebKitLegacy/mac/WebView/WebDataSource.mm
    M Source/WebKitLegacy/mac/WebView/WebFrameView.mm
    M Source/WebKitLegacy/mac/WebView/WebView.mm

  Log Message:
  -----------
  Remove respondsToSelector checks from where they are no longer needed
https://bugs.webkit.org/show_bug.cgi?id=252901

Reviewed by Aditya Keerthi.

In some cases, we know the selectors we are checking for exist because
they are unconditionally included in the header files.

Other times, we know they exist because the OSes that do not support
these methods are no longer supported.

According to https://build.webkit.org/dashboard/, we no longer support:
- Anything before macOS 12
- Anything before tvOS 16
- Anything before iOS 16
- Anything before watchOS 9

So any respondsToSelector calls for the sake of the OSes that do not fit
the criteria above can be removed.

* Source/WTF/wtf/PlatformHave.h: Added HAVE_NSSHARINGSERVICEPICKER
  macro.

* Source/WebCore/bridge/objc/objc_instance.mm:
  (JSC::Bindings::ObjcInstance::setValueOfUndefinedField):
  Remove comment because it is misleading.
  (JSC::Bindings::ObjcInstance::getValueOfUndefinedField const): Ditto.

* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
  (WebCore::initTypeForRequest): Remove check because
  AVContentKeyRequest.options was added in 10.14.4, and earliest
  supported macOS is macOS 12.

* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
  (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
  Remove check because setRate:time:atHostTime: is now a public API.
  (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): Ditto.

* Source/WebCore/platform/network/cocoa/CookieCocoa.mm: Remove check
  because sameSitePolicy is now a public API.

* Source/WebKit/Platform/cocoa/ImageAnalysisUtilities.mm:
  (WebKit::makeTextRecognitionResult): Remove check because
  isPassthrough is explicitly defined in the interface definition in the
  header.

* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
  (WebKit::WebContextMenuProxyMac::getShareMenuItem): Replace selector
  check with a check for HAVE_NSSHARINGSERVICEPICKER because
  standardShareMenuItem is definitely a Ventura addition. Because
  getStandardShareMenuItem cannot be called from macOS 13 and above due
  to NSSHARINGSERVICEPICKER being available, getStandardShareMenuItem
  has been wrapped around a check for not having NSSHARINGSERVICEPICKER.

* Source/WebKitLegacy/mac/WebView/WebView.mm:
  (-[WebView _handleContextMenuTranslation:]): Remove check because the
  modern counterpart does not check either, meaning this is safe to
  remove.

Canonical link: https://commits.webkit.org/266235@main




More information about the webkit-changes mailing list