Changeset 271072 in webkit


Ignore:
Timestamp:
Dec 23, 2020, 10:51:36 AM (4 years ago)
Author:
Simon Fraser
Message:

REGRESSION: Scroll snapping triggers body scroll
https://bugs.webkit.org/show_bug.cgi?id=220056
Source/WebCore:

<rdar://problem/72595482>

Reviewed by Wenson Hsieh.

ScrollController::handleWheelEvent() needs to return true to indicate that it
handled the event when it has been processed for scroll snap. If we don't do this,
the latching code thinks that no node handled the event so the latch times out.

Test: fast/scrolling/latching/scroll-snap-latching.html

  • platform/cocoa/ScrollController.h:
  • platform/cocoa/ScrollController.mm:

(WebCore::ScrollController::handleWheelEvent):

LayoutTests:

Reviewed by Wenson Hsieh.

  • fast/scrolling/latching/scroll-snap-latching-expected.txt: Added.
  • fast/scrolling/latching/scroll-snap-latching.html: Added.
  • platform/mac-wk1/fast/scrolling/latching/scroll-snap-latching-expected.txt: Added.
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r271070 r271072  
     12020-12-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION: Scroll snapping triggers body scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=220056
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        * fast/scrolling/latching/scroll-snap-latching-expected.txt: Added.
     9        * fast/scrolling/latching/scroll-snap-latching.html: Added.
     10        * platform/mac-wk1/fast/scrolling/latching/scroll-snap-latching-expected.txt: Added.
     11
    1122020-12-23  Simon Fraser  <simon.fraser@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r271070 r271072  
     12020-12-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION: Scroll snapping triggers body scroll
     4        https://bugs.webkit.org/show_bug.cgi?id=220056
     5        <rdar://problem/72595482>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        ScrollController::handleWheelEvent() needs to return true to indicate that it
     10        handled the event when it has been processed for scroll snap. If we don't do this,
     11        the latching code thinks that no node handled the event so the latch times out.
     12
     13        Test: fast/scrolling/latching/scroll-snap-latching.html
     14
     15        * platform/cocoa/ScrollController.h:
     16        * platform/cocoa/ScrollController.mm:
     17        (WebCore::ScrollController::handleWheelEvent):
     18
    1192020-12-23  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/platform/cocoa/ScrollController.h

    r271070 r271072  
    140140
    141141#if PLATFORM(MAC)
     142    // Returns true if handled.
    142143    bool handleWheelEvent(const PlatformWheelEvent&);
    143144#endif
     
    168169    float adjustScrollDestinationForDirectionalSnapping(ScrollEventAxis, float destination, float velocity, float originalPosition);
    169170#if PLATFORM(MAC)
     171    // Returns true if handled.
    170172    bool processWheelEventForScrollSnap(const PlatformWheelEvent&);
    171173#endif
  • trunk/Source/WebCore/platform/cocoa/ScrollController.mm

    r271070 r271072  
    122122#if ENABLE(CSS_SCROLL_SNAP)
    123123    if (processWheelEventForScrollSnap(wheelEvent))
    124         return false; // FIXME: Why don't we report that we handled it?
     124        return true;
    125125#endif
    126126    if (wheelEvent.phase() == PlatformWheelEventPhase::MayBegin || wheelEvent.phase() == PlatformWheelEventPhase::Cancelled)
Note: See TracChangeset for help on using the changeset viewer.