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

Changeset 285797 in webkit


Ignore:
Timestamp:
Nov 14, 2021, 8:06:38 PM (5 years ago)
Author:
Simon Fraser
Message:

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.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285787 r285797  
     12021-11-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fingers down on the trackpad should stop an animated scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=233114
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        * fast/scrolling/mac/momentum-animator-maybegin-stops-expected.txt: Added.
     9        * fast/scrolling/mac/momentum-animator-maybegin-stops.html: Added.
     10
    1112021-11-13  Simon Fraser  <simon.fraser@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r285796 r285797  
     12021-11-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fingers down on the trackpad should stop an animated scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=233114
     5
     6        Reviewed by Wenson Hsieh.
     7       
     8        Fingers down on the trackpad sends a "MayBegin" event; this needs to stop any in-progress
     9        animated momentum scroll.
     10
     11        This failed because ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent() early-returned
     12        on the MayBegin event before it got to ScrollingEffectsController. Fix that, and have
     13        ScrollingEffectsController::handleWheelEvent() return true to say it was handled.
     14
     15        This triggered an assertion in ScrollingTreeGestureState, but for "post-main-thread"
     16        handling for which the assertion was wrong.
     17
     18        Test: fast/scrolling/mac/momentum-animator-maybegin-stops.html
     19
     20        * page/scrolling/ScrollingTreeGestureState.cpp:
     21        (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent):
     22        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
     23        (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
     24        * platform/mac/ScrollingEffectsController.mm:
     25        (WebCore::ScrollingEffectsController::handleWheelEvent):
     26
    1272021-11-14  Said Abou-Hallawa  <said@apple.com>
    228
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeGestureState.cpp

    r270389 r285797  
    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:
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm

    r285526 r285797  
    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}
  • trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm

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