Changeset 167634 in webkit


Ignore:
Timestamp:
Apr 21, 2014 5:05:02 PM (10 years ago)
Author:
Brent Fulgham
Message:

[Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally
https://bugs.webkit.org/show_bug.cgi?id=131959
<rdar://problem/16654523>

Reviewed by Simon Fraser.

  • page/mac/EventHandlerMac.mm:

(WebCore::deltaIsPredominantlyVertical): Added.
(WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
the element style indicates that overflow is hidden, since this means there is no scroll possible in that
direction.
(WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167632 r167634  
     12014-04-21  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally
     4        https://bugs.webkit.org/show_bug.cgi?id=131959
     5        <rdar://problem/16654523>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * page/mac/EventHandlerMac.mm:
     10        (WebCore::deltaIsPredominantlyVertical): Added.
     11        (WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
     12        overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
     13        the element style indicates that overflow is hidden, since this means there is no scroll possible in that
     14        direction.
     15        (WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.
     16
    1172014-04-21  Eric Carlson  <eric.carlson@apple.com>
    218
  • trunk/Source/WebCore/page/mac/EventHandlerMac.mm

    r167560 r167634  
    753753}
    754754
    755 static bool scrolledToEdgeInDominantDirection(const ScrollableArea& area, DominantScrollGestureDirection direction, float deltaX, float deltaY)
    756 {
    757     if (DominantScrollGestureDirection::Horizontal == direction && deltaX) {
     755static bool deltaIsPredominantlyVertical(float deltaX, float deltaY)
     756{
     757    return std::abs(deltaY) > std::abs(deltaX);
     758}
     759   
     760static bool scrolledToEdgeInDominantDirection(const ContainerNode& container, const ScrollableArea& area, float deltaX, float deltaY)
     761{
     762    if (!container.renderer())
     763        return true;
     764
     765    const RenderStyle& style = container.renderer()->style();
     766
     767    if (!deltaIsPredominantlyVertical(deltaX, deltaY) && deltaX) {
     768        if (style.overflowX() == OHIDDEN)
     769            return true;
     770
    758771        if (deltaX < 0)
    759772            return area.scrolledToRight();
     
    761774        return area.scrolledToLeft();
    762775    }
    763    
     776
     777    if (style.overflowY() == OHIDDEN)
     778        return true;
     779
    764780    if (deltaY < 0)
    765781        return area.scrolledToBottom();
     
    791807    if (wheelEvent.shouldConsiderLatching()) {
    792808        if (scrollableArea)
    793             m_startedGestureAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableArea, m_recentWheelEventDeltaTracker->dominantScrollGestureDirection(), wheelEvent.deltaX(), wheelEvent.deltaY());
     809            m_startedGestureAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableContainer, *scrollableArea, wheelEvent.deltaX(), wheelEvent.deltaY());
    794810        else
    795811            m_startedGestureAtScrollLimit = false;
Note: See TracChangeset for help on using the changeset viewer.