⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285942 in webkit


Ignore:
Timestamp:
Nov 17, 2021, 11:14:37 AM (5 years ago)
Author:
Alan Coon
Message:

Cherry-pick r285797. rdar://problem/85512520

Fingers down on the trackpad should stop an animated scroll
https://bugs.webkit.org/show_bug.cgi?id=233114

Reviewed by Wenson Hsieh.
Source/WebCore:

Fingers down on the trackpad sends a "MayBegin" event; this needs to stop any in-progress
animated momentum scroll.

This failed because ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent() early-returned
on the MayBegin event before it got to ScrollingEffectsController. Fix that, and have
ScrollingEffectsController::handleWheelEvent() return true to say it was handled.

This triggered an assertion in ScrollingTreeGestureState, but for "post-main-thread"
handling for which the assertion was wrong.

Test: fast/scrolling/mac/momentum-animator-maybegin-stops.html

  • page/scrolling/ScrollingTreeGestureState.cpp: (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent):
  • page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
  • platform/mac/ScrollingEffectsController.mm: (WebCore::ScrollingEffectsController::handleWheelEvent):

LayoutTests:

  • fast/scrolling/mac/momentum-animator-maybegin-stops-expected.txt: Added.
  • fast/scrolling/mac/momentum-animator-maybegin-stops.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285797 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-613.1.9.0-branch
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613.1.9.0-branch/LayoutTests/ChangeLog

    r285787 r285942  
     12021-11-17  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r285797. rdar://problem/85512520
     4
     5    Fingers down on the trackpad should stop an animated scroll
     6    https://bugs.webkit.org/show_bug.cgi?id=233114
     7   
     8    Reviewed by Wenson Hsieh.
     9    Source/WebCore:
     10   
     11    Fingers down on the trackpad sends a "MayBegin" event; this needs to stop any in-progress
     12    animated momentum scroll.
     13   
     14    This failed because ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent() early-returned
     15    on the MayBegin event before it got to ScrollingEffectsController. Fix that, and have
     16    ScrollingEffectsController::handleWheelEvent() return true to say it was handled.
     17   
     18    This triggered an assertion in ScrollingTreeGestureState, but for "post-main-thread"
     19    handling for which the assertion was wrong.
     20   
     21    Test: fast/scrolling/mac/momentum-animator-maybegin-stops.html
     22   
     23    * page/scrolling/ScrollingTreeGestureState.cpp:
     24    (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent):
     25    * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
     26    (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
     27    * platform/mac/ScrollingEffectsController.mm:
     28    (WebCore::ScrollingEffectsController::handleWheelEvent):
     29   
     30    LayoutTests:
     31   
     32    * fast/scrolling/mac/momentum-animator-maybegin-stops-expected.txt: Added.
     33    * fast/scrolling/mac/momentum-animator-maybegin-stops.html: Added.
     34   
     35   
     36    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     37
     38    2021-11-14  Simon Fraser  <simon.fraser@apple.com>
     39
     40            Fingers down on the trackpad should stop an animated scroll
     41            https://bugs.webkit.org/show_bug.cgi?id=233114
     42
     43            Reviewed by Wenson Hsieh.
     44
     45            * fast/scrolling/mac/momentum-animator-maybegin-stops-expected.txt: Added.
     46            * fast/scrolling/mac/momentum-animator-maybegin-stops.html: Added.
     47
    1482021-11-13  Simon Fraser  <simon.fraser@apple.com>
    249
  • branches/safari-613.1.9.0-branch/Source/WebCore/ChangeLog

    r285941 r285942  
     12021-11-17  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r285797. rdar://problem/85512520
     4
     5    Fingers down on the trackpad should stop an animated scroll
     6    https://bugs.webkit.org/show_bug.cgi?id=233114
     7   
     8    Reviewed by Wenson Hsieh.
     9    Source/WebCore:
     10   
     11    Fingers down on the trackpad sends a "MayBegin" event; this needs to stop any in-progress
     12    animated momentum scroll.
     13   
     14    This failed because ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent() early-returned
     15    on the MayBegin event before it got to ScrollingEffectsController. Fix that, and have
     16    ScrollingEffectsController::handleWheelEvent() return true to say it was handled.
     17   
     18    This triggered an assertion in ScrollingTreeGestureState, but for "post-main-thread"
     19    handling for which the assertion was wrong.
     20   
     21    Test: fast/scrolling/mac/momentum-animator-maybegin-stops.html
     22   
     23    * page/scrolling/ScrollingTreeGestureState.cpp:
     24    (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent):
     25    * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
     26    (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
     27    * platform/mac/ScrollingEffectsController.mm:
     28    (WebCore::ScrollingEffectsController::handleWheelEvent):
     29   
     30    LayoutTests:
     31   
     32    * fast/scrolling/mac/momentum-animator-maybegin-stops-expected.txt: Added.
     33    * fast/scrolling/mac/momentum-animator-maybegin-stops.html: Added.
     34   
     35   
     36    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     37
     38    2021-11-14  Simon Fraser  <simon.fraser@apple.com>
     39
     40            Fingers down on the trackpad should stop an animated scroll
     41            https://bugs.webkit.org/show_bug.cgi?id=233114
     42
     43            Reviewed by Wenson Hsieh.
     44
     45            Fingers down on the trackpad sends a "MayBegin" event; this needs to stop any in-progress
     46            animated momentum scroll.
     47
     48            This failed because ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent() early-returned
     49            on the MayBegin event before it got to ScrollingEffectsController. Fix that, and have
     50            ScrollingEffectsController::handleWheelEvent() return true to say it was handled.
     51
     52            This triggered an assertion in ScrollingTreeGestureState, but for "post-main-thread"
     53            handling for which the assertion was wrong.
     54
     55            Test: fast/scrolling/mac/momentum-animator-maybegin-stops.html
     56
     57            * page/scrolling/ScrollingTreeGestureState.cpp:
     58            (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent):
     59            * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
     60            (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
     61            * platform/mac/ScrollingEffectsController.mm:
     62            (WebCore::ScrollingEffectsController::handleWheelEvent):
     63
    1642021-11-17  Alan Coon  <alancoon@apple.com>
    265
  • branches/safari-613.1.9.0-branch/Source/WebCore/page/scrolling/ScrollingTreeGestureState.cpp

    r270389 r285942  
    6767        break;
    6868    case PlatformWheelEventPhase::Cancelled:
    69         // handleGestureCancel() should have been called first.
    70         ASSERT_NOT_REACHED();
     69        // We can get here for via handleWheelEventAfterMainThread(), in which case handleGestureCancel() was not called first.
     70        handleGestureCancel(event);
    7171        break;
    7272    case PlatformWheelEventPhase::Began:
  • branches/safari-613.1.9.0-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm

    r285526 r285942  
    107107        scrollingNode().setUserScrollInProgress(isInUserScroll);
    108108
    109     // PlatformWheelEventPhase::MayBegin fires when two fingers touch the trackpad, and is used to flash overlay scrollbars.
    110     // We know we're scrollable at this point, so handle the event.
    111     if (wheelEvent.phase() == PlatformWheelEventPhase::MayBegin)
    112         return true;
    113 
    114109    return m_scrollController.handleWheelEvent(wheelEvent);
    115110}
  • branches/safari-613.1.9.0-branch/Source/WebCore/platform/mac/ScrollingEffectsController.mm

    r285787 r285942  
    141141            stopAnimatedScroll();
    142142        }
    143         return false;
     143        return true;
    144144    }
    145145
Note: See TracChangeset for help on using the changeset viewer.