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

Changeset 263838 in webkit


Ignore:
Timestamp:
Jul 2, 2020, 2:19:12 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Kinetic scrolling is still triggered if you wait before lifting fingers
https://bugs.webkit.org/show_bug.cgi?id=213789

Patch by Alexander Mikhaylenko <Alexander Mikhaylenko> on 2020-07-02
Reviewed by Carlos Garcia Campos.

The intended behavior for kinetic scrolling is that it's possible to not trigger it by
stopping moving fingers before lifting them, as opposed to doing a fling/swipe. However,
right now it's broken and trying to do this triggers kinetic scrolling as well.

Currently, the last scroll event with (0, 0) deltas isn't added to the scroll history for
kinetic scrolling. However, this is wrong, because the last event, or rather the timespan
between it and the previous scroll event, actually determines the kinetic scrolling velocity:
if this event follows the previous one quickly, the velocity is large, but if there was a long
pause, the velocity would be close to 0.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1902 and
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1903 for the equivalent GTK fixes.

  • page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:

(WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):

  • page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:

(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):

  • platform/generic/ScrollAnimatorGeneric.cpp:

(WebCore::ScrollAnimatorGeneric::handleWheelEvent):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r263836 r263838  
     12020-07-02  Alexander Mikhaylenko  <alexm@gnome.org>
     2
     3        [GTK] Kinetic scrolling is still triggered if you wait before lifting fingers
     4        https://bugs.webkit.org/show_bug.cgi?id=213789
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        The intended behavior for kinetic scrolling is that it's possible to not trigger it by
     9        stopping moving fingers before lifting them, as opposed to doing a fling/swipe. However,
     10        right now it's broken and trying to do this triggers kinetic scrolling as well.
     11
     12        Currently, the last scroll event with (0, 0) deltas isn't added to the scroll history for
     13        kinetic scrolling. However, this is wrong, because the last event, or rather the timespan
     14        between it and the previous scroll event, actually determines the kinetic scrolling velocity:
     15        if this event follows the previous one quickly, the velocity is large, but if there was a long
     16        pause, the velocity would be close to 0.
     17
     18        See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1902 and
     19        https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1903 for the equivalent GTK fixes.
     20
     21        * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
     22        (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
     23        * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
     24        (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
     25        * platform/generic/ScrollAnimatorGeneric.cpp:
     26        (WebCore::ScrollAnimatorGeneric::handleWheelEvent):
     27
    1282020-07-02  Philippe Normand  <pnormand@igalia.com>
    229
  • trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp

    r262294 r263838  
    128128        scrollBy({ -wheelEvent.deltaX(), -wheelEvent.deltaY() });
    129129
    130 #if ENABLE(KINETIC_SCROLLING)
    131         m_kineticAnimation->appendToScrollHistory(wheelEvent);
    132 #endif
    133     }
     130    }
     131
     132#if ENABLE(KINETIC_SCROLLING)
     133    m_kineticAnimation->appendToScrollHistory(wheelEvent);
     134#endif
    134135
    135136#if ENABLE(KINETIC_SCROLLING)
  • trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp

    r262294 r263838  
    112112        auto updateScope = compositionLayer.createUpdateScope();
    113113        scrollBy({ -wheelEvent.deltaX(), -wheelEvent.deltaY() });
     114    }
    114115
    115116#if ENABLE(KINETIC_SCROLLING)
    116         m_kineticAnimation->appendToScrollHistory(wheelEvent);
     117    m_kineticAnimation->appendToScrollHistory(wheelEvent);
    117118#endif
    118     }
    119119
    120120#if ENABLE(KINETIC_SCROLLING)
  • trunk/Source/WebCore/platform/generic/ScrollAnimatorGeneric.cpp

    r259112 r263838  
    113113
    114114#if ENABLE(KINETIC_SCROLLING)
     115    m_kineticAnimation->appendToScrollHistory(event);
     116
    115117    if (event.isEndOfNonMomentumScroll()) {
    116         // We don't need to add the event to the history as its delta will be (0, 0).
    117118        m_kineticAnimation->start(m_currentPosition, m_kineticAnimation->computeVelocity(), m_scrollableArea.horizontalScrollbar(), m_scrollableArea.verticalScrollbar());
    118119        return true;
     
    123124        return true;
    124125    }
    125 
    126     m_kineticAnimation->appendToScrollHistory(event);
    127126#endif
    128127
Note: See TracChangeset for help on using the changeset viewer.