Source/WebCore: Sideways 'wobble' when scrolling with trackpad on Mavericks
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 19:04:21 +0000 (19:04 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 19:04:21 +0000 (19:04 +0000)
commitd8f996511b1369ce1b8999612ed84d32d413f023
tree0e733a055761ce466a43d82e1f2c38c2ab83962c
parent806b968e68fd8f77a1ab06d88fd88d696a06020c
Source/WebCore: Sideways 'wobble' when scrolling with trackpad on Mavericks
https://bugs.webkit.org/show_bug.cgi?id=127521
-and corresponding-
<rdar://problem/14137306>

Reviewed by Simon Fraser.

This patch takes http://trac.webkit.org/changeset/154535 which introduced
filtering wheel events for overflow areas to try to make them less sensitive to X
deltas when scrolling in a primarily Y direction, and it factors that code out
into its own class, now called WheelEventDeltaTracker. So now this new class can
use the same code to filter events for WebKit2’s EventDispatcher.

Files for WheelEventDeltaTracker.
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

WK2 needs these new WheelEventDeltaTracker functions.
* WebCore.exp.in:

Move a bunch of code over to WheelEventDeltaTracker and use
m_recentWheelEventTracker to serve the same purpose.
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/EventHandler.h:

Allow horizontal rubber banding now that we have some event filtering in place.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):

New files. Most of this code was from EventHandler.
* page/WheelEventDeltaTracker.cpp: Added.
(WebCore::WheelEventDeltaTracker::WheelEventDeltaTracker):
(WebCore::WheelEventDeltaTracker::~WheelEventDeltaTracker):
(WebCore::WheelEventDeltaTracker::beginTrackingDeltas):
(WebCore::WheelEventDeltaTracker::endTrackingDeltas):
(WebCore::WheelEventDeltaTracker::recordWheelEventDelta):
(WebCore::deltaIsPredominantlyVertical):
(WebCore::WheelEventDeltaTracker::dominantScrollGestureDirection):
* page/WheelEventDeltaTracker.h: Added.
(WebCore::WheelEventDeltaTracker::isTrackingDeltas):

New function to clone events while zero-ing out certain deltas.
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyIgnoringHorizontalDelta):
(WebCore::PlatformWheelEvent::copyIgnoringVerticalDelta):

Source/WebKit2: Sideways 'wobble' when scrolling with trackpad on Mavericks
https://bugs.webkit.org/show_bug.cgi?id=127521
-and corresponding-
<rdar://problem/14137306>

Reviewed by Simon Fraser.

Start using WebCore::WheelEventDeltaTracker to filter events.
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::EventDispatcher):
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/EventDispatcher.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/WheelEventDeltaTracker.cpp [new file with mode: 0644]
Source/WebCore/page/WheelEventDeltaTracker.h [new file with mode: 0644]
Source/WebCore/platform/PlatformWheelEvent.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
Source/WebKit2/WebProcess/WebPage/EventDispatcher.h