Extend DOM WheelEvent to differentiate between physical and logical scroll directions
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 18:06:44 +0000 (18:06 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 18:06:44 +0000 (18:06 +0000)
commitbefa4839c59248964d260648990b7ad3c02d630f
tree0e341936276469a0f6b7e7281facfcaada9d11ea
parent868eb85ae07fcb0b1449775a09459622d49d943d
Extend DOM WheelEvent to differentiate between physical and logical scroll directions
https://bugs.webkit.org/show_bug.cgi?id=68959
<rdar://problem/10036688>

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* wtf/Platform.h: Added HAVE_INVERTED_WHEEL_EVENTS for Lion and later.

Source/WebCore:

Test: fast/events/wheelevent-direction-inverted-from-device.html

* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::initWheelEvent):
(WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator):
* dom/WheelEvent.h:
(WebCore::WheelEvent::create):
(WebCore::WheelEvent::webkitDirectionInvertedFromDevice):
* dom/WheelEvent.idl: Added the webkitDirectionInvertedFromDevice idl attribute.
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
(WebCore::PlatformWheelEvent::webkitDirectionInvertedFromDevice):
* platform/efl/PlatformWheelEventEfl.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false.
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false.
* platform/mac/WheelEventMac.mm:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): if building on Lion or later, use
[NSEvent isDirectionInvertedFromDevice].
* platform/qt/WheelEventQt.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false.
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false.
* platform/wx/MouseWheelEventWx.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false.

Source/WebKit2:

* Shared/WebEvent.h:
(WebKit::WebWheelEvent::directionInvertedFromDevice):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
(WebKit::WebWheelEvent::encode):
(WebKit::WebWheelEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebWheelEvent): get the flag from the NSEvent.
* UIProcess/WebPageProxy.cpp:
(WebKit::coalesce):

LayoutTests:

* fast/events/wheelevent-direction-inverted-from-device-expected.txt: Added.
* fast/events/wheelevent-direction-inverted-from-device.html: Added.
* platform/mac-wk2/Skipped: WKTR does not support mouse scroll events yet.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog [changed mode: 0755->0644]
LayoutTests/fast/events/wheelevent-direction-inverted-from-device-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/wheelevent-direction-inverted-from-device.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/Skipped
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/Platform.h
Source/WebCore/ChangeLog [changed mode: 0755->0644]
Source/WebCore/dom/WheelEvent.cpp
Source/WebCore/dom/WheelEvent.h
Source/WebCore/dom/WheelEvent.idl
Source/WebCore/platform/PlatformWheelEvent.h
Source/WebCore/platform/efl/PlatformWheelEventEfl.cpp
Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp
Source/WebCore/platform/mac/WheelEventMac.mm
Source/WebCore/platform/qt/WheelEventQt.cpp
Source/WebCore/platform/win/WheelEventWin.cpp
Source/WebCore/platform/wx/MouseWheelEventWx.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebEvent.h
Source/WebKit2/Shared/WebEventConversion.cpp
Source/WebKit2/Shared/WebWheelEvent.cpp
Source/WebKit2/Shared/mac/WebEventFactory.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp