[webkit-changes] [WebKit/WebKit] a609e0: Stop using -_canScrollWithoutBouncing(X|Y) and -_a...

Wenson Hsieh noreply at github.com
Tue Oct 10 20:56:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a609e0dfd7633783fb3ec2342d1ce0db20f0c637
      https://github.com/WebKit/WebKit/commit/a609e0dfd7633783fb3ec2342d1ce0db20f0c637
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-10-10 (Tue, 10 Oct 2023)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M Source/WebKit/UIProcess/ios/UIKitUtilities.h
    M Source/WebKit/UIProcess/ios/UIKitUtilities.mm
    M Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm
    M Source/WebKit/UIProcess/ios/WKVelocityTrackingScrollView.mm

  Log Message:
  -----------
  Stop using -_canScrollWithoutBouncing(X|Y) and -_adjustedContentOffsetForContentOffset: on UIScrollView
https://bugs.webkit.org/show_bug.cgi?id=262973

Reviewed by Richard Robinson.

Remove uses of these three SPI methods and properties on `UIScrollView`, which are currently just
used for smooth keyboard scrolling on iOS:

```
-_canScrollWithoutBouncingX
-_canScrollWithoutBouncingY
-_adjustedContentOffsetForContentOffset:
```

Instead, we use a combination `-adjustedContentInset`, `-contentSize` and `-bounds` to both compute
the scroll extents and total content dimensions of the content scroll view, and to adjust a given
content offset to fit within the extents.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:

Remove the now-unnecessary SPI declarations.

* Source/WebKit/UIProcess/ios/UIKitUtilities.h:
* Source/WebKit/UIProcess/ios/UIKitUtilities.mm:
(-[UIScrollView _wk_contentWidthIncludingInsets]):
(-[UIScrollView _wk_contentHeightIncludingInsets]):
(-[UIScrollView _wk_isScrolledBeyondExtents]):
(-[UIScrollView _wk_clampToScrollExtents:]):
(-[UIScrollView _wk_canScrollHorizontallyWithoutBouncing]):
(-[UIScrollView _wk_canScrollVerticallyWithoutBouncing]):
* Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollViewAnimator boundedContentOffset:]):
(-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
* Source/WebKit/UIProcess/ios/WKVelocityTrackingScrollView.mm:

Drive-by fix: remove an unnecessary header import for `FixedVector.h`.
Canonical link: https://commits.webkit.org/269186@main




More information about the webkit-changes mailing list