Skip to content
  • simon.fraser@apple.com's avatar
    Improve scrolling behavior in iTunes · 55c4f794
    simon.fraser@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=120241
    <rdar://problem/14825344>
    
    Reviewed by Sam Weinig.
    
    When vertically scrolling a page with horizontally scrollable overflow areas,
    vertical scroll gestures would be interrupted when wheel events with non-zero
    X deltas were intercepted by the overflow areas.
    
    Fix by storing a small history of wheel events deltas and using
    it to determine of the scroll gesture is primarily vertical or horizontal.
    When this is detected, avoid dispatching scroll events on the on the
    non-dominant axis.
    
    Currently this behavior is conditionalized to only apply in iTunes.
    
    * page/EventHandler.cpp:
    (WebCore::EventHandler::EventHandler):
    (WebCore::EventHandler::recordWheelEventDelta):
    (WebCore::deltaIsPredominantlyVertical):
    (WebCore::EventHandler::dominantScrollGestureDirection):
    (WebCore::EventHandler::handleWheelEvent):
    (WebCore::EventHandler::defaultWheelEventHandler):
    * page/EventHandler.h:
    * platform/RuntimeApplicationChecks.cpp:
    (WebCore::applicationIsITunes):
    * platform/RuntimeApplicationChecks.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    55c4f794