Changeset 96613 in webkit
- Timestamp:
- Oct 4, 2011 11:06:44 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
- Property svn:executable deleted
r96610 r96613 1 2011-10-03 Jon Lee <jonlee@apple.com> 2 3 Extend DOM WheelEvent to differentiate between physical and logical scroll directions 4 https://bugs.webkit.org/show_bug.cgi?id=68959 5 <rdar://problem/10036688> 6 7 Reviewed by Sam Weinig. 8 9 * fast/events/wheelevent-direction-inverted-from-device-expected.txt: Added. 10 * fast/events/wheelevent-direction-inverted-from-device.html: Added. 11 * platform/mac-wk2/Skipped: WKTR does not support mouse scroll events yet. 12 1 13 2011-10-03 Ken Buchanan <kenrb@chromium.org> 2 14 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r96439 r96613 158 158 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html 159 159 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html 160 fast/events/wheelevent-direction-inverted-from-device.html 160 161 fast/files/apply-blob-url-to-xhr.html 161 162 fast/files/file-reader-abort.html -
trunk/Source/JavaScriptCore/ChangeLog
r96598 r96613 1 2011-10-03 Jon Lee <jonlee@apple.com> 2 3 Extend DOM WheelEvent to differentiate between physical and logical scroll directions 4 https://bugs.webkit.org/show_bug.cgi?id=68959 5 <rdar://problem/10036688> 6 7 Reviewed by Sam Weinig. 8 9 * wtf/Platform.h: Added HAVE_INVERTED_WHEEL_EVENTS for Lion and later. 10 1 11 2011-10-04 Csaba Osztrogonác <ossy@webkit.org> 2 12 -
trunk/Source/JavaScriptCore/wtf/Platform.h
r96545 r96613 1105 1105 #endif 1106 1106 1107 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) 1108 #define HAVE_INVERTED_WHEEL_EVENTS 1 1109 #endif 1110 1107 1111 #endif /* WTF_Platform_h */ -
trunk/Source/WebCore/ChangeLog
- Property svn:executable deleted
r96612 r96613 1 2011-10-03 Jon Lee <jonlee@apple.com> 2 3 Extend DOM WheelEvent to differentiate between physical and logical scroll directions 4 https://bugs.webkit.org/show_bug.cgi?id=68959 5 <rdar://problem/10036688> 6 7 Reviewed by Sam Weinig. 8 9 Test: fast/events/wheelevent-direction-inverted-from-device.html 10 11 * dom/WheelEvent.cpp: 12 (WebCore::WheelEvent::WheelEvent): 13 (WebCore::WheelEvent::initWheelEvent): 14 (WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator): 15 * dom/WheelEvent.h: 16 (WebCore::WheelEvent::create): 17 (WebCore::WheelEvent::webkitDirectionInvertedFromDevice): 18 * dom/WheelEvent.idl: Added the webkitDirectionInvertedFromDevice idl attribute. 19 * platform/PlatformWheelEvent.h: 20 (WebCore::PlatformWheelEvent::PlatformWheelEvent): 21 (WebCore::PlatformWheelEvent::webkitDirectionInvertedFromDevice): 22 * platform/efl/PlatformWheelEventEfl.cpp: 23 (WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false. 24 * platform/gtk/PlatformWheelEventGtk.cpp: 25 (WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false. 26 * platform/mac/WheelEventMac.mm: 27 (WebCore::PlatformWheelEvent::PlatformWheelEvent): if building on Lion or later, use 28 [NSEvent isDirectionInvertedFromDevice]. 29 * platform/qt/WheelEventQt.cpp: 30 (WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false. 31 * platform/win/WheelEventWin.cpp: 32 (WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false. 33 * platform/wx/MouseWheelEventWx.cpp: 34 (WebCore::PlatformWheelEvent::PlatformWheelEvent): default to false. 35 1 36 2011-10-04 Rémi Duraffort <remi.duraffort@st.com> 2 37 -
trunk/Source/WebCore/dom/WheelEvent.cpp
r92266 r96613 40 40 Granularity granularity, PassRefPtr<AbstractView> view, 41 41 const IntPoint& screenLocation, const IntPoint& pageLocation, 42 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) 42 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, 43 bool directionInvertedFromDevice) 43 44 : MouseRelatedEvent(eventNames().mousewheelEvent, 44 45 true, true, view, 0, screenLocation, pageLocation, … … 47 48 , m_rawDelta(roundedIntPoint(rawDelta)) 48 49 , m_granularity(granularity) 50 , m_directionInvertedFromDevice(directionInvertedFromDevice) 49 51 { 50 52 } … … 70 72 m_rawDelta = IntPoint(rawDeltaX, rawDeltaY); 71 73 m_granularity = Pixel; 72 74 m_directionInvertedFromDevice = false; 75 73 76 initCoordinates(IntPoint(pageX, pageY)); 74 77 } … … 102 105 return; 103 106 104 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), granularity(event),105 view, IntPoint(event.globalX(), event.globalY()), IntPoint(event.x(), event.y()), event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey()));106 107 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), 108 granularity(event), view, IntPoint(event.globalX(), event.globalY()), IntPoint(event.x(), event.y()), 109 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.webkitDirectionInvertedFromDevice())); 107 110 } 108 111 -
trunk/Source/WebCore/dom/WheelEvent.h
r93385 r96613 45 45 const FloatPoint& rawDelta, Granularity granularity, PassRefPtr<AbstractView> view, 46 46 const IntPoint& screenLocation, const IntPoint& pageLocation, 47 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey )47 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice) 48 48 { 49 49 return adoptRef(new WheelEvent(wheelTicks, rawDelta, granularity, view, 50 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey ));50 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice)); 51 51 } 52 52 … … 66 66 Granularity granularity() const { return m_granularity; } 67 67 68 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; } 68 69 // Needed for Objective-C legacy support 69 70 bool isHorizontal() const { return m_wheelDelta.x(); } … … 74 75 Granularity granularity, PassRefPtr<AbstractView>, 75 76 const IntPoint& screenLocation, const IntPoint& pageLocation, 76 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey );77 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice); 77 78 78 79 virtual bool isWheelEvent() const; … … 81 82 IntPoint m_rawDelta; 82 83 Granularity m_granularity; 84 bool m_directionInvertedFromDevice; 83 85 }; 84 86 -
trunk/Source/WebCore/dom/WheelEvent.idl
r91617 r96613 40 40 readonly attribute long x; 41 41 readonly attribute long y; 42 readonly attribute boolean webkitDirectionInvertedFromDevice; 42 43 43 44 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C -
trunk/Source/WebCore/platform/PlatformWheelEvent.h
r92699 r96613 98 98 , m_altKey(false) 99 99 , m_metaKey(false) 100 , m_directionInvertedFromDevice(false) 100 101 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) 101 102 , m_hasPreciseScrollingDeltas(false) … … 120 121 , m_altKey(altKey) 121 122 , m_metaKey(metaKey) 123 , m_directionInvertedFromDevice(false) 122 124 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) 123 125 , m_hasPreciseScrollingDeltas(false) … … 150 152 int globalX() const { return m_globalPosition.x(); } // Screen coordinates. 151 153 int globalY() const { return m_globalPosition.y(); } 154 155 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; } 152 156 153 157 void accept() { m_isAccepted = true; } … … 216 220 bool m_altKey; 217 221 bool m_metaKey; 222 bool m_directionInvertedFromDevice; 218 223 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) 219 224 bool m_hasPreciseScrollingDeltas; -
trunk/Source/WebCore/platform/efl/PlatformWheelEventEfl.cpp
r95901 r96613 52 52 , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt")) 53 53 , m_metaKey(evas_key_modifier_is_set(ev->modifiers, "Meta")) 54 , m_directionInvertedFromDevice(false) 54 55 { 55 56 // A negative z value means (in EFL) that we are scrolling down, so we need -
trunk/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp
r83429 r96613 68 68 m_altKey = event->state & GDK_MOD1_MASK; 69 69 m_metaKey = event->state & GDK_META_MASK; 70 m_directionInvertedFromDevice = false; 70 71 71 72 // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event -
trunk/Source/WebCore/platform/mac/WheelEventMac.mm
r82709 r96613 116 116 m_hasPreciseScrollingDeltas = false; 117 117 } 118 119 #if HAVE(INVERTED_WHEEL_EVENTS) 120 m_directionInvertedFromDevice = [event isDirectionInvertedFromDevice]; 121 #else 122 m_directionInvertedFromDevice = false; 123 #endif 118 124 } 119 125 -
trunk/Source/WebCore/platform/qt/WheelEventQt.cpp
r75467 r96613 68 68 , m_altKey(e->modifiers() & Qt::AltModifier) 69 69 , m_metaKey(e->modifiers() & Qt::MetaModifier) 70 , m_directionInvertedFromDevice(false) 70 71 #endif 71 72 { … … 87 88 , m_altKey(e->modifiers() & Qt::AltModifier) 88 89 , m_metaKey(e->modifiers() & Qt::MetaModifier) 90 , m_directionInvertedFromDevice(false) 89 91 #endif 90 92 { -
trunk/Source/WebCore/platform/win/WheelEventWin.cpp
r45304 r96613 72 72 , m_altKey(false) 73 73 , m_metaKey(false) 74 , m_directionInvertedFromDevice(false) 74 75 { 75 76 m_deltaX = delta.width(); … … 96 97 , m_altKey(GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT) 97 98 , m_metaKey(m_altKey) // FIXME: We'll have to test other browsers 99 , m_directionInvertedFromDevice(false) 98 100 { 99 101 // How many pixels should we scroll per line? Gecko uses the height of the -
trunk/Source/WebCore/platform/wx/MouseWheelEventWx.cpp
r54345 r96613 46 46 , m_wheelTicksY(m_deltaY) 47 47 , m_isAccepted(false) 48 , m_directionInvertedFromDevice(false) 48 49 { 49 50 // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event -
trunk/Source/WebKit2/ChangeLog
r96611 r96613 1 2011-10-03 Jon Lee <jonlee@apple.com> 2 3 Extend DOM WheelEvent to differentiate between physical and logical scroll directions 4 https://bugs.webkit.org/show_bug.cgi?id=68959 5 <rdar://problem/10036688> 6 7 Reviewed by Sam Weinig. 8 9 * Shared/WebEvent.h: 10 (WebKit::WebWheelEvent::directionInvertedFromDevice): 11 * Shared/WebEventConversion.cpp: 12 (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): 13 * Shared/WebWheelEvent.cpp: 14 (WebKit::WebWheelEvent::WebWheelEvent): 15 (WebKit::WebWheelEvent::encode): 16 (WebKit::WebWheelEvent::decode): 17 * Shared/mac/WebEventFactory.mm: 18 (WebKit::WebEventFactory::createWebWheelEvent): get the flag from the NSEvent. 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::coalesce): 21 1 22 2011-10-04 Nayan Kumar K <nayankk@motorola.com> 2 23 -
trunk/Source/WebKit2/Shared/WebEvent.h
r95901 r96613 180 180 WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Modifiers, double timestamp); 181 181 #if PLATFORM(MAC) 182 WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Phase phase, Phase momentumPhase,bool hasPreciseScrollingDeltas, Modifiers, double timestamp);182 WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, Modifiers, double timestamp, bool directionInvertedFromDevice); 183 183 #endif 184 184 … … 188 188 const WebCore::FloatSize wheelTicks() const { return m_wheelTicks; } 189 189 Granularity granularity() const { return static_cast<Granularity>(m_granularity); } 190 bool directionInvertedFromDevice() const { return m_directionInvertedFromDevice; } 190 191 #if PLATFORM(MAC) 191 192 Phase phase() const { return static_cast<Phase>(m_phase); } … … 205 206 WebCore::FloatSize m_wheelTicks; 206 207 uint32_t m_granularity; // Granularity 208 bool m_directionInvertedFromDevice; 207 209 #if PLATFORM(MAC) 208 210 uint32_t m_phase; // Phase -
trunk/Source/WebKit2/Shared/WebEventConversion.cpp
r95901 r96613 111 111 m_altKey = webEvent.altKey(); 112 112 m_metaKey = webEvent.metaKey(); 113 m_directionInvertedFromDevice = webEvent.directionInvertedFromDevice(); 113 114 #if PLATFORM(MAC) 114 115 m_phase = static_cast<WebCore::PlatformWheelEventPhase>(webEvent.phase()); -
trunk/Source/WebKit2/Shared/WebWheelEvent.cpp
r95901 r96613 41 41 , m_wheelTicks(wheelTicks) 42 42 , m_granularity(granularity) 43 , m_directionInvertedFromDevice(false) 43 44 #if PLATFORM(MAC) 44 45 , m_phase(PhaseNone) … … 50 51 51 52 #if PLATFORM(MAC) 52 WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Phase phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, Modifiers modifiers, double timestamp )53 WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Phase phase, Phase momentumPhase, bool hasPreciseScrollingDeltas, Modifiers modifiers, double timestamp, bool directionInvertedFromDevice) 53 54 : WebEvent(type, modifiers, timestamp) 54 55 , m_position(position) … … 57 58 , m_wheelTicks(wheelTicks) 58 59 , m_granularity(granularity) 60 , m_directionInvertedFromDevice(directionInvertedFromDevice) 59 61 , m_phase(phase) 60 62 , m_momentumPhase(momentumPhase) … … 74 76 encoder->encode(m_wheelTicks); 75 77 encoder->encode(m_granularity); 78 encoder->encode(m_directionInvertedFromDevice); 76 79 #if PLATFORM(MAC) 77 80 encoder->encode(m_phase); … … 95 98 if (!decoder->decode(t.m_granularity)) 96 99 return false; 100 if (!decoder->decode(t.m_directionInvertedFromDevice)) 101 return false; 97 102 #if PLATFORM(MAC) 98 103 if (!decoder->decode(t.m_phase)) -
trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm
r95901 r96613 1097 1097 WebEvent::Modifiers modifiers = modifiersForEvent(event); 1098 1098 double timestamp = [event timestamp]; 1099 1100 return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, phase, momentumPhase, hasPreciseScrollingDeltas, modifiers, timestamp); 1099 #if HAVE(INVERTED_WHEEL_EVENTS) 1100 bool directionInvertedFromDevice = [event isDirectionInvertedFromDevice]; 1101 #else 1102 bool directionInvertedFromDevice = false; 1103 #endif 1104 return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, phase, momentumPhase, hasPreciseScrollingDeltas, modifiers, timestamp, directionInvertedFromDevice); 1101 1105 } 1102 1106 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r96439 r96613 2671 2671 2672 2672 #if PLATFORM(MAC) 2673 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.modifiers(), b.timestamp() );2673 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.phase(), b.momentumPhase(), b.hasPreciseScrollingDeltas(), b.modifiers(), b.timestamp(), b.directionInvertedFromDevice()); 2674 2674 #else 2675 2675 return WebWheelEvent(WebEvent::Wheel, b.position(), b.globalPosition(), mergedDelta, mergedWheelTicks, b.granularity(), b.modifiers(), b.timestamp());
Note: See TracChangeset
for help on using the changeset viewer.