Bug 233788 - Implement CSS overscroll-behavior for iOS
Summary: Implement CSS overscroll-behavior for iOS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nikos Mouchtaris
URL:
Keywords: InRadar
: 233787 (view as bug list)
Depends on:
Blocks: 176454
  Show dependency treegraph
 
Reported: 2021-12-02 16:22 PST by Nikos Mouchtaris
Modified: 2022-02-17 17:32 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.47 KB, patch)
2021-12-02 16:47 PST, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (3.53 KB, patch)
2021-12-07 14:58 PST, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (3.53 KB, patch)
2021-12-07 16:49 PST, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (3.24 KB, patch)
2021-12-09 12:37 PST, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (3.24 KB, patch)
2021-12-09 14:57 PST, Nikos Mouchtaris
simon.fraser: review+
Details | Formatted Diff | Diff
overscroll-behavior ios (3.19 KB, patch)
2021-12-09 15:48 PST, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (3.19 KB, patch)
2022-01-28 19:26 PST, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Mouchtaris 2021-12-02 16:22:08 PST
Implement CSS overscroll-behavior for iOS
Comment 1 Nikos Mouchtaris 2021-12-02 16:47:28 PST
Created attachment 445791 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-12-06 15:29:47 PST
<rdar://problem/86126776>
Comment 3 Nikos Mouchtaris 2021-12-07 14:58:10 PST
Created attachment 446239 [details]
Patch
Comment 4 Nikos Mouchtaris 2021-12-07 16:49:53 PST
Created attachment 446255 [details]
Patch
Comment 5 Simon Fraser (smfr) 2021-12-09 11:16:14 PST
Comment on attachment 446255 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=446255&action=review

Why is there no layout test with this?

> Source/WebKit/ChangeLog:10
> +        to UIKit by Russell Ladd, to allow controlling of scroll chaining.

I don't think this level of detail needs to be in the webkit changelog.

> Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:261
> +            scrollView.bouncesHorizontally = params.horizontalOverscrollBehavior == OverscrollBehavior::None ? NO : YES;
> +            scrollView.bouncesVertically = scrollingStateNode.scrollableAreaParameters().verticalOverscrollBehavior == OverscrollBehavior::None ? NO : YES;
> +            scrollView._allowsParentToBeginHorizontally = scrollingStateNode.scrollableAreaParameters().horizontalOverscrollBehavior != OverscrollBehavior::Auto ? NO : YES;
> +            scrollView._allowsParentToBeginVertically = scrollingStateNode.scrollableAreaParameters().verticalOverscrollBehavior != OverscrollBehavior::Auto ? NO : YES;

params vs scrollingStateNode.scrollableAreaParameters() ?
Comment 6 Nikos Mouchtaris 2021-12-09 12:37:46 PST
Created attachment 446588 [details]
Patch
Comment 7 Nikos Mouchtaris 2021-12-09 14:57:24 PST
Created attachment 446615 [details]
Patch
Comment 8 Darin Adler 2021-12-09 15:26:33 PST
Comment on attachment 446615 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=446615&action=review

> Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:261
> +            scrollView.bouncesHorizontally = params.horizontalOverscrollBehavior == OverscrollBehavior::None ? NO : YES;
> +            scrollView.bouncesVertically = params.verticalOverscrollBehavior == OverscrollBehavior::None ? NO : YES;
> +            scrollView._allowsParentToBeginHorizontally = params.horizontalOverscrollBehavior != OverscrollBehavior::Auto ? NO : YES;
> +            scrollView._allowsParentToBeginVertically = params.verticalOverscrollBehavior != OverscrollBehavior::Auto ? NO : YES;

Since this is all Boolean logic, we could rewrite it to not use ? NO : YES so much, like this:

     scrollView.bouncesHorizontally = params.horizontalOverscrollBehavior != OverscrollBehavior::None;

Fine to land what was reviewed, but I would prefer the more direct boolean style rather than one that implements "!" using "? NO : YES" syntax.
Comment 9 Nikos Mouchtaris 2021-12-09 15:48:41 PST
Created attachment 446625 [details]
overscroll-behavior ios
Comment 10 Nikos Mouchtaris 2022-01-28 19:26:35 PST
Created attachment 450302 [details]
Patch
Comment 11 EWS 2022-01-28 20:23:50 PST
Committed r288782 (246559@main): <https://commits.webkit.org/246559@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450302 [details].
Comment 12 Nikos Mouchtaris 2022-02-17 17:32:10 PST
*** Bug 233787 has been marked as a duplicate of this bug. ***