Diff
Modified: trunk/Source/WebCore/ChangeLog (96638 => 96639)
--- trunk/Source/WebCore/ChangeLog 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/ChangeLog 2011-10-04 20:44:05 UTC (rev 96639)
@@ -1,3 +1,31 @@
+2011-10-04 Anders Carlsson <[email protected]>
+
+ Use const PlatformWheelEvent references where possible
+ https://bugs.webkit.org/show_bug.cgi?id=69367
+
+ Reviewed by Sam Weinig.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleWheelEvent):
+ * platform/ScrollAnimator.cpp:
+ (WebCore::ScrollAnimator::handleWheelEvent):
+ * platform/ScrollAnimator.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::wheelEvent):
+ * platform/ScrollView.h:
+ * platform/ScrollableArea.cpp:
+ (WebCore::ScrollableArea::handleWheelEvent):
+ * platform/ScrollableArea.h:
+ * platform/chromium/ScrollAnimatorChromiumMac.h:
+ * platform/chromium/ScrollAnimatorChromiumMac.mm:
+ (WebCore::ScrollAnimatorChromiumMac::handleWheelEvent):
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::isScrollingLeftAndShouldNotRubberBand):
+ (WebCore::isScrollingRightAndShouldNotRubberBand):
+ (WebCore::ScrollAnimatorMac::handleWheelEvent):
+ (WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
+
2011-10-04 Andreas Kling <[email protected]>
Shrink HTMLTableCellElement.
Modified: trunk/Source/WebCore/page/EventHandler.cpp (96638 => 96639)
--- trunk/Source/WebCore/page/EventHandler.cpp 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2011-10-04 20:44:05 UTC (rev 96639)
@@ -2167,6 +2167,7 @@
isOverWidget = result.isOverWidget();
}
+ // FIXME: This should not mutate the event.
if (shouldTurnVerticalTicksIntoHorizontal(result))
e.turnVerticalTicksIntoHorizontal();
Modified: trunk/Source/WebCore/platform/ScrollAnimator.cpp (96638 => 96639)
--- trunk/Source/WebCore/platform/ScrollAnimator.cpp 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/ScrollAnimator.cpp 2011-10-04 20:44:05 UTC (rev 96639)
@@ -81,7 +81,7 @@
}
}
-bool ScrollAnimator::handleWheelEvent(PlatformWheelEvent& e)
+bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
{
Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar();
Modified: trunk/Source/WebCore/platform/ScrollAnimator.h (96638 => 96639)
--- trunk/Source/WebCore/platform/ScrollAnimator.h 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/ScrollAnimator.h 2011-10-04 20:44:05 UTC (rev 96639)
@@ -63,7 +63,7 @@
virtual void setIsActive() { }
- virtual bool handleWheelEvent(PlatformWheelEvent&);
+ virtual bool handleWheelEvent(const PlatformWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
virtual void handleGestureEvent(const PlatformGestureEvent&);
#endif
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (96638 => 96639)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2011-10-04 20:44:05 UTC (rev 96639)
@@ -797,7 +797,7 @@
platformSetScrollbarOverlayStyle(overlayStyle);
}
-bool ScrollView::wheelEvent(PlatformWheelEvent& e)
+bool ScrollView::wheelEvent(const PlatformWheelEvent& e)
{
// We don't allow mouse wheeling to happen in a ScrollView that has had its scrollbars explicitly disabled.
#if PLATFORM(WX)
Modified: trunk/Source/WebCore/platform/ScrollView.h (96638 => 96639)
--- trunk/Source/WebCore/platform/ScrollView.h 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/ScrollView.h 2011-10-04 20:44:05 UTC (rev 96639)
@@ -234,7 +234,7 @@
// This function exists for scrollviews that need to handle wheel events manually.
// On Mac the underlying NSScrollView just does the scrolling, but on other platforms
// (like Windows), we need this function in order to do the scroll ourselves.
- bool wheelEvent(PlatformWheelEvent&);
+ bool wheelEvent(const PlatformWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
void gestureEvent(const PlatformGestureEvent&);
#endif
Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (96638 => 96639)
--- trunk/Source/WebCore/platform/ScrollableArea.cpp 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp 2011-10-04 20:44:05 UTC (rev 96639)
@@ -123,7 +123,7 @@
scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), y));
}
-bool ScrollableArea::handleWheelEvent(PlatformWheelEvent& wheelEvent)
+bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
return scrollAnimator()->handleWheelEvent(wheelEvent);
}
Modified: trunk/Source/WebCore/platform/ScrollableArea.h (96638 => 96639)
--- trunk/Source/WebCore/platform/ScrollableArea.h 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/ScrollableArea.h 2011-10-04 20:44:05 UTC (rev 96639)
@@ -52,7 +52,7 @@
void scrollToXOffsetWithoutAnimation(float x);
void scrollToYOffsetWithoutAnimation(float x);
- bool handleWheelEvent(PlatformWheelEvent&);
+ bool handleWheelEvent(const PlatformWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
void handleGestureEvent(const PlatformGestureEvent&);
#endif
Modified: trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.h (96638 => 96639)
--- trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.h 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.h 2011-10-04 20:44:05 UTC (rev 96639)
@@ -59,7 +59,7 @@
virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
#if ENABLE(RUBBER_BANDING)
- virtual bool handleWheelEvent(PlatformWheelEvent&) OVERRIDE;
+ virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
#if ENABLE(GESTURE_EVENTS)
virtual void handleGestureEvent(const PlatformGestureEvent&);
#endif
Modified: trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm (96638 => 96639)
--- trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm 2011-10-04 20:44:05 UTC (rev 96639)
@@ -781,7 +781,7 @@
return wheelEvent.deltaX() < 0 && !scrollableArea->shouldRubberBandInDirection(ScrollRight);
}
-bool ScrollAnimatorChromiumMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
+bool ScrollAnimatorChromiumMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
m_haveScrolledSincePageLoad = true;
Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h (96638 => 96639)
--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h 2011-10-04 20:44:05 UTC (rev 96639)
@@ -62,7 +62,7 @@
virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
#if ENABLE(RUBBER_BANDING)
- virtual bool handleWheelEvent(PlatformWheelEvent&) OVERRIDE;
+ virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
#if ENABLE(GESTURE_EVENTS)
virtual void handleGestureEvent(const PlatformGestureEvent&);
#endif
@@ -137,7 +137,7 @@
bool pinnedInDirection(float deltaX, float deltaY);
void snapRubberBand();
void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*);
- void smoothScrollWithEvent(PlatformWheelEvent&);
+ void smoothScrollWithEvent(const PlatformWheelEvent&);
void beginScrollGesture();
void endScrollGesture();
Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (96638 => 96639)
--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2011-10-04 20:39:45 UTC (rev 96638)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2011-10-04 20:44:05 UTC (rev 96639)
@@ -782,17 +782,17 @@
return multiplier;
}
-static inline bool isScrollingLeftAndShouldNotRubberBand(PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
+static inline bool isScrollingLeftAndShouldNotRubberBand(const PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
{
return wheelEvent.deltaX() > 0 && !scrollableArea->shouldRubberBandInDirection(ScrollLeft);
}
-static inline bool isScrollingRightAndShouldNotRubberBand(PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
+static inline bool isScrollingRightAndShouldNotRubberBand(const PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
{
return wheelEvent.deltaX() < 0 && !scrollableArea->shouldRubberBandInDirection(ScrollRight);
}
-bool ScrollAnimatorMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
+bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
m_haveScrolledSincePageLoad = true;
@@ -923,7 +923,7 @@
return false;
}
-void ScrollAnimatorMac::smoothScrollWithEvent(PlatformWheelEvent& wheelEvent)
+void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEvent)
{
m_haveScrolledSincePageLoad = true;