Skip to content
Permalink
Browse files
Implement CSS overscroll-behavior for iOS
https://bugs.webkit.org/show_bug.cgi?id=233788

Reviewed by Simon Fraser.

Add setting of ScrollView parameters based on overscroll-behavior values.

* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):



Canonical link: https://commits.webkit.org/246559@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
nmoucht committed Jan 29, 2022
1 parent 9051fca commit 89ff6ccadd4727ed002d83e415aad37054e7881f
Showing 2 changed files with 23 additions and 2 deletions.
@@ -1,3 +1,15 @@
2022-01-28 Nikolaos Mouchtaris <nmouchtaris@apple.com>

Implement CSS overscroll-behavior for iOS
https://bugs.webkit.org/show_bug.cgi?id=233788

Reviewed by Simon Fraser.

Add setting of ScrollView parameters based on overscroll-behavior values.

* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

2022-01-28 Per Arne Vollan <pvollan@apple.com>

[macOS][WP] Temporarily add syscall to sandbox
@@ -230,7 +230,8 @@ - (void)cancelPointersForGestureRecognizer:(UIGestureRecognizer *)gestureRecogni
|| scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::TotalContentsSize)
|| scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ReachableContentsSize)
|| scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollPosition)
|| scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollOrigin)) {
|| scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollOrigin)
|| scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollableAreaParams)) {
BEGIN_BLOCK_OBJC_EXCEPTIONS
UIScrollView *scrollView = this->scrollView();
if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollContainerLayer)) {
@@ -251,7 +252,15 @@ - (void)cancelPointersForGestureRecognizer:(UIGestureRecognizer *)gestureRecogni
scrollView.contentSize = scrollingStateNode.reachableContentsSize();
recomputeInsets = true;
}

#if HAVE(UIKIT_OVERSCROLL_BEHAVIOR_SUPPORT)
if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollableAreaParams)) {
auto params = scrollingStateNode.scrollableAreaParameters();
scrollView.bouncesHorizontally = params.horizontalOverscrollBehavior != OverscrollBehavior::None;
scrollView.bouncesVertically = params.verticalOverscrollBehavior != OverscrollBehavior::None;
scrollView._allowsParentToBeginHorizontally = params.horizontalOverscrollBehavior == OverscrollBehavior::Auto;
scrollView._allowsParentToBeginVertically = params.verticalOverscrollBehavior == OverscrollBehavior::Auto;
}
#endif
if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrollOrigin))
recomputeInsets = true;

0 comments on commit 89ff6cc

Please sign in to comment.