[webkit-changes] [WebKit/WebKit] 57c88b: REGRESSION (271171 at main): Unable to scroll web vie...

Wenson Hsieh noreply at github.com
Tue Jan 2 10:42:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 57c88bfd87f4f5907337cc6a81a988188281d7a4
      https://github.com/WebKit/WebKit/commit/57c88bfd87f4f5907337cc6a81a988188281d7a4
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-01-02 (Tue, 02 Jan 2024)

  Changed paths:
    M Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h
    M Source/WebCore/platform/RuntimeApplicationChecks.h
    M Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
    M Source/WebKit/UIProcess/ios/WKBaseScrollView.mm

  Log Message:
  -----------
  REGRESSION (271171 at main): Unable to scroll web views using pan gesture in the 喜马拉雅 app
https://bugs.webkit.org/show_bug.cgi?id=266856
rdar://119851795

Reviewed by Aditya Keerthi.

Add a temporary workaround to keep scrolling in web views working in the 喜马拉雅 app on iOS. The
changes in 271171 at main added an implementation of `-addGestureRecognizer:` to the new common WebKit
scroll view subclass, `WKBaseScrollView`. This causes bincompat issues in this app, due to how the
app intercepts all invocations of `-[UIView addGestureRecognizer:]` using the ObjC runtime functions
`class_getInstanceMethod` and `method_setImplementation`. For reasons that are still unclear, it
avoids calling into the original implementation in UIKit in the case where the method is invoked in
the context of a `objc_msgSendSuper` call from within a subclass, which results in the pan gesture
not being installed on the scroll view at all.

To mitigate this, we refactor this code to avoid implementing `-addGestureRecognizer:` on the scroll
view subclass altogether for this app (behind a linked-on-or-after check, such that it will force
this app to eventually fix this when updating to a new iOS SDK).

No change in behavior, outside of 喜马拉雅.

* Source/WTF/wtf/cocoa/RuntimeApplicationChecksCocoa.h:
* Source/WebCore/platform/RuntimeApplicationChecks.h:
* Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isHimalaya):
* Source/WebKit/UIProcess/ios/WKBaseScrollView.mm:
(-[WKBaseScrollView initWithFrame:]):
(+[WKBaseScrollView _overrideAddGestureRecognizerIfNeeded]):

See above for more details — don't implement and override `-addGestureRecognizer:` in this subclass
when this app-specific quirk is active.

(-[WKBaseScrollView _wk_addGestureRecognizer:]):
(-[WKBaseScrollView addGestureRecognizer:]): Deleted.

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




More information about the webkit-changes mailing list