Diff
Modified: trunk/Source/WebCore/ChangeLog (103195 => 103196)
--- trunk/Source/WebCore/ChangeLog 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/ChangeLog 2011-12-19 00:42:03 UTC (rev 103196)
@@ -1,3 +1,33 @@
+2011-12-18 Sam Weinig <[email protected]>
+
+ Make EventHandler::handleWheelEvent take const PlatformWheelEvent&
+ https://bugs.webkit.org/show_bug.cgi?id=74824
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.exp.in:
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleWheelEvent):
+ * page/EventHandler.h:
+ * page/blackberry/EventHandlerBlackBerry.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/chromium/EventHandlerChromium.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/efl/EventHandlerEfl.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/gtk/EventHandlerGtk.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/qt/EventHandlerQt.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/win/EventHandlerWin.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * page/wx/EventHandlerWx.cpp:
+ (WebCore::EventHandler::passWheelEventToWidget):
+ * platform/PlatformWheelEvent.h:
+ (WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks):
+
2011-12-18 James Kozianski <[email protected]>
[chromium] Add worldId parameter to allowScriptExtension()
Modified: trunk/Source/WebCore/WebCore.exp.in (103195 => 103196)
--- trunk/Source/WebCore/WebCore.exp.in 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-12-19 00:42:03 UTC (rev 103196)
@@ -230,7 +230,7 @@
__ZN7WebCore12EventHandler14currentNSEventEv
__ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE
__ZN7WebCore12EventHandler15handleAccessKeyERKNS_21PlatformKeyboardEventE
-__ZN7WebCore12EventHandler16handleWheelEventERNS_18PlatformWheelEventE
+__ZN7WebCore12EventHandler16handleWheelEventERKNS_18PlatformWheelEventE
__ZN7WebCore12EventHandler17scrollRecursivelyENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE
__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEjRKNS_7IntSizeE
__ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
Modified: trunk/Source/WebCore/page/EventHandler.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/EventHandler.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -2132,7 +2132,7 @@
}
#endif
-bool EventHandler::handleWheelEvent(PlatformWheelEvent& e)
+bool EventHandler::handleWheelEvent(const PlatformWheelEvent& e)
{
Document* doc = m_frame->document();
@@ -2177,9 +2177,12 @@
isOverWidget = result.isOverWidget();
}
- // FIXME: This should not mutate the event.
+ // FIXME: It should not be necessary to do this mutation here.
+ // Instead, the handlers should know convert vertical scrolls
+ // appropriately.
+ PlatformWheelEvent event = e;
if (shouldTurnVerticalTicksIntoHorizontal(result))
- e.turnVerticalTicksIntoHorizontal();
+ event = event.copyTurningVerticalTicksIntoHorizontalTicks();
if (node) {
// Figure out which view to send the event to.
@@ -2192,7 +2195,7 @@
}
node = node->shadowAncestorNode();
- if (node && !node->dispatchWheelEvent(e))
+ if (node && !node->dispatchWheelEvent(event))
return true;
}
@@ -2202,7 +2205,7 @@
if (!view)
return false;
- return view->wheelEvent(e);
+ return view->wheelEvent(event);
}
void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEvent)
Modified: trunk/Source/WebCore/page/EventHandler.h (103195 => 103196)
--- trunk/Source/WebCore/page/EventHandler.h 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/EventHandler.h 2011-12-19 00:42:03 UTC (rev 103196)
@@ -155,7 +155,7 @@
bool handleMousePressEvent(const PlatformMouseEvent&);
bool handleMouseMoveEvent(const PlatformMouseEvent&, HitTestResult* hoveredNode = 0, bool _onlyUpdateScrollbars_ = false);
bool handleMouseReleaseEvent(const PlatformMouseEvent&);
- bool handleWheelEvent(PlatformWheelEvent&);
+ bool handleWheelEvent(const PlatformWheelEvent&);
void defaultWheelEventHandler(Node*, WheelEvent*);
#if ENABLE(GESTURE_EVENTS)
@@ -299,7 +299,7 @@
bool passWidgetMouseDownEventToWidget(RenderWidget*);
bool passMouseDownEventToWidget(Widget*);
- bool passWheelEventToWidget(PlatformWheelEvent&, Widget*);
+ bool passWheelEventToWidget(const PlatformWheelEvent&, Widget*);
void defaultSpaceEventHandler(KeyboardEvent*);
void defaultBackspaceEventHandler(KeyboardEvent*);
Modified: trunk/Source/WebCore/page/blackberry/EventHandlerBlackBerry.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/blackberry/EventHandlerBlackBerry.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/blackberry/EventHandlerBlackBerry.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -57,7 +57,7 @@
return true;
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent&, Widget*)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent&, Widget*)
{
notImplemented();
return false;
Modified: trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -85,7 +85,7 @@
return true;
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& wheelEvent, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& wheelEvent, Widget* widget)
{
// We can sometimes get a null widget! EventHandlerMac handles a null
// widget by returning false, so we do the same.
Modified: trunk/Source/WebCore/page/efl/EventHandlerEfl.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/efl/EventHandlerEfl.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/efl/EventHandlerEfl.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -86,7 +86,7 @@
return false;
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget* widget)
{
ASSERT(widget);
if (!widget->isFrameView())
Modified: trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -85,7 +85,7 @@
return false;
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget* widget)
{
ASSERT(widget);
if (!widget->isFrameView())
Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (103195 => 103196)
--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm 2011-12-19 00:42:03 UTC (rev 103196)
@@ -419,7 +419,7 @@
[self release];
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& wheelEvent, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& wheelEvent, Widget* widget)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
Modified: trunk/Source/WebCore/page/qt/EventHandlerQt.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/qt/EventHandlerQt.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/qt/EventHandlerQt.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -89,7 +89,7 @@
return false;
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget* widget)
{
Q_ASSERT(widget);
if (!widget->isFrameView())
Modified: trunk/Source/WebCore/page/win/EventHandlerWin.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/win/EventHandlerWin.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/win/EventHandlerWin.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -73,7 +73,7 @@
return true;
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& wheelEvent, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& wheelEvent, Widget* widget)
{
if (!widget->isFrameView())
return false;
Modified: trunk/Source/WebCore/page/wx/EventHandlerWx.cpp (103195 => 103196)
--- trunk/Source/WebCore/page/wx/EventHandlerWx.cpp 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/page/wx/EventHandlerWx.cpp 2011-12-19 00:42:03 UTC (rev 103196)
@@ -74,7 +74,7 @@
return passMouseDownEventToWidget(renderWidget->widget());
}
-bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget* widget)
{
if (!widget || !widget->isFrameView())
return false;
Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (103195 => 103196)
--- trunk/Source/WebCore/platform/PlatformWheelEvent.h 2011-12-19 00:37:49 UTC (rev 103195)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h 2011-12-19 00:42:03 UTC (rev 103196)
@@ -121,6 +121,18 @@
{
}
+ PlatformWheelEvent copyTurningVerticalTicksIntoHorizontalTicks() const
+ {
+ PlatformWheelEvent copy = *this;
+
+ copy.m_deltaX = copy.m_deltaY;
+ copy.m_deltaY = 0;
+ copy.m_wheelTicksX = copy.m_wheelTicksY;
+ copy.m_wheelTicksY = 0;
+
+ return copy;
+ }
+
const IntPoint& pos() const { return m_position; } // PlatformWindow coordinates.
const IntPoint& globalPos() const { return m_globalPosition; } // Screen coordinates.
@@ -134,15 +146,6 @@
bool directionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
- void turnVerticalTicksIntoHorizontal()
- {
- m_deltaX = m_deltaY;
- m_deltaY = 0;
-
- m_wheelTicksX = m_wheelTicksY;
- m_wheelTicksY = 0;
- }
-
#if PLATFORM(GTK)
PlatformWheelEvent(GdkEventScroll*);
#endif