Changeset 291497 in webkit
- Timestamp:
- Mar 18, 2022 2:59:15 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior-expected.txt (added)
-
LayoutTests/scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingTree.cpp (modified) (1 diff)
-
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (modified) (2 diffs)
-
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r291493 r291497 1 2022-03-18 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 3 Allow history swipe in scroller with overscroll-behavior 4 https://bugs.webkit.org/show_bug.cgi?id=235851 5 6 Reviewed by Simon Fraser. 7 8 * scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior-expected.txt: Added. 9 * scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior.html: Added. 10 1 11 2022-03-18 Simon Fraser <simon.fraser@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r291496 r291497 1 2022-03-18 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 3 Allow history swipe in scroller with overscroll-behavior 4 https://bugs.webkit.org/show_bug.cgi?id=235851 5 6 Reviewed by Simon Fraser. 7 8 Re-add code to allow history swipe. Does so by returning unhandled if a horizontal 9 swipe is used. Also add test to make sure history swipes are allowed in scrolling nodes 10 with overscroll-behavior. 11 12 Test: scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior.html 13 14 * page/scrolling/ScrollingTree.cpp: 15 (WebCore::ScrollingTree::handleWheelEventWithNode): 16 * page/scrolling/ScrollingTreeScrollingNode.cpp: 17 (WebCore::ScrollingTreeScrollingNode::shouldRubberBand const): 18 (WebCore::ScrollingTreeScrollingNode::computeScrollPropagation const): 19 (WebCore::ScrollingTreeScrollingNode::shouldBlockScrollPropagation const): Deleted. 20 * page/scrolling/ScrollingTreeScrollingNode.h: 21 1 22 2022-03-18 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r290575 r291497 218 218 return result; 219 219 220 if (scrollingNode.shouldBlockScrollPropagation(adjustedWheelEvent.delta())) { 220 auto scrollPropagationInfo = scrollingNode.computeScrollPropagation(adjustedWheelEvent.delta()); 221 if (scrollPropagationInfo.shouldBlockScrollPropagation) { 222 if (!scrollPropagationInfo.isHandled) 223 return WheelEventHandlingResult::unhandled(); 221 224 m_latchingController.nodeDidHandleEvent(scrollingNode.scrollingNodeID(), processingSteps, adjustedWheelEvent, m_allowLatching); 222 225 m_gestureState.nodeDidHandleEvent(scrollingNode.scrollingNodeID(), adjustedWheelEvent); -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
r289074 r291497 129 129 // Also rubberband when we should block scroll propagation 130 130 // at this node, which has overscroll behavior that is not none. 131 return (isLatchedNode() || eventTargeting == EventTargeting::NodeOnly || (isRootNode() && !wheelEvent.isNonGestureEvent()) || (shouldBlockScrollPropagation(wheelEvent.delta()) && overscrollBehaviorAllowsRubberBand())); 131 auto scrollPropagationInfo = computeScrollPropagation(wheelEvent.delta()); 132 return (isLatchedNode() || eventTargeting == EventTargeting::NodeOnly || (isRootNode() && !wheelEvent.isNonGestureEvent()) || ( scrollPropagationInfo.shouldBlockScrollPropagation && scrollPropagationInfo.isHandled && overscrollBehaviorAllowsRubberBand())); 132 133 } 133 134 … … 419 420 } 420 421 421 bool ScrollingTreeScrollingNode::shouldBlockScrollPropagation(const FloatSize& delta) const 422 { 423 return ((horizontalOverscrollBehaviorPreventsPropagation() || verticalOverscrollBehaviorPreventsPropagation()) && ((horizontalOverscrollBehaviorPreventsPropagation() && verticalOverscrollBehaviorPreventsPropagation()) || (horizontalOverscrollBehaviorPreventsPropagation() && !delta.height()) || (verticalOverscrollBehaviorPreventsPropagation() && !delta.width()))); 422 ScrollPropagationInfo ScrollingTreeScrollingNode::computeScrollPropagation(const FloatSize& delta) const 423 { 424 ScrollPropagationInfo propagation; 425 if (!horizontalOverscrollBehaviorPreventsPropagation() && !verticalOverscrollBehaviorPreventsPropagation()) 426 return propagation; 427 428 // History swipe case 429 if (horizontalOverscrollBehaviorPreventsPropagation() && !delta.height() && delta.width()) { 430 propagation.shouldBlockScrollPropagation = true; 431 propagation.isHandled = false; 432 return propagation; 433 } 434 435 if ((horizontalOverscrollBehaviorPreventsPropagation() && verticalOverscrollBehaviorPreventsPropagation()) 436 || (horizontalOverscrollBehaviorPreventsPropagation() && !delta.height()) 437 || (verticalOverscrollBehaviorPreventsPropagation() && !delta.width())) { 438 propagation.shouldBlockScrollPropagation = true; 439 propagation.isHandled = true; 440 } 441 return propagation; 424 442 } 425 443 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
r291198 r291497 40 40 struct WheelEventHandlingResult; 41 41 42 struct ScrollPropagationInfo { 43 bool shouldBlockScrollPropagation { false }; 44 bool isHandled { false }; 45 }; 46 42 47 class WEBCORE_EXPORT ScrollingTreeScrollingNode : public ScrollingTreeNode { 43 48 friend class ScrollingTreeScrollingNodeDelegate; … … 166 171 bool verticalOverscrollBehaviorPreventsPropagation() const { return m_scrollableAreaParameters.verticalOverscrollBehavior != OverscrollBehavior::Auto; } 167 172 PlatformWheelEvent eventForPropagation(const PlatformWheelEvent&) const; 168 bool shouldBlockScrollPropagation(const FloatSize&) const;173 ScrollPropagationInfo computeScrollPropagation(const FloatSize&) const; 169 174 bool overscrollBehaviorAllowsRubberBand() const { return m_scrollableAreaParameters.horizontalOverscrollBehavior != OverscrollBehavior::None || m_scrollableAreaParameters.verticalOverscrollBehavior != OverscrollBehavior::None; } 170 175 bool shouldRubberBand(const PlatformWheelEvent&, EventTargeting) const;
Note: See TracChangeset
for help on using the changeset viewer.