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

Changeset 286566 in webkit


Ignore:
Timestamp:
Dec 6, 2021, 1:31:41 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Momentum Event Dispatcher: Momentum phase runs backwards with natural scrolling disabled
https://bugs.webkit.org/show_bug.cgi?id=233894
<rdar://problem/86111948>

Reviewed by Simon Fraser.

  • WebProcess/WebPage/MomentumEventDispatcher.cpp:

(WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime):
Only flip the deltas if the trackpad is configured to use "natural"
scrolling (in which "directionInvertedFromDevice" is true).

(WebKit::MomentumEventDispatcher::computeNextDelta):
Fix initial queue state logging to log both axes before setting the "did log" bit.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r286564 r286566  
     12021-12-06  Tim Horton  <timothy_horton@apple.com>
     2
     3        Momentum Event Dispatcher: Momentum phase runs backwards with natural scrolling disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=233894
     5        <rdar://problem/86111948>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     10        (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime):
     11        Only flip the deltas if the trackpad is configured to use "natural"
     12        scrolling (in which "directionInvertedFromDevice" is true).
     13
     14        (WebKit::MomentumEventDispatcher::computeNextDelta):
     15        Fix initial queue state logging to log both axes before setting the "did log" bit.
     16
    1172021-12-06  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp

    r286537 r286566  
    307307    m_currentGesture.currentOffset += delta;
    308308
    309     return -delta;
     309    if (m_currentGesture.initiatingEvent->directionInvertedFromDevice())
     310        delta.scale(-1);
     311
     312    return delta;
    310313}
    311314
     
    479482
    480483#if ENABLE(MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING)
    481         if (!m_currentGesture.didLogInitialQueueState) {
     484        if (!m_currentGesture.didLogInitialQueueState)
    482485            RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher initial historical deltas: average delta %f, average time %fms, event count %d", averageDelta, averageFrameIntervalMS, count);
    483             m_currentGesture.didLogInitialQueueState = true;
    484         }
    485486#endif
    486487
     
    503504    );
    504505
     506#if ENABLE(MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING)
     507    m_currentGesture.didLogInitialQueueState = true;
     508#endif
     509
    505510    return { unacceleratedDelta, acceleratedDelta };
    506511}
Note: See TracChangeset for help on using the changeset viewer.