Commit 741fa5dc authored by andersca@apple.com's avatar andersca@apple.com

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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 29746dcd
2011-10-04 Anders Carlsson <andersca@apple.com>
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 <kling@webkit.org>
Shrink HTMLTableCellElement.
......@@ -2167,6 +2167,7 @@ bool EventHandler::handleWheelEvent(PlatformWheelEvent& e)
isOverWidget = result.isOverWidget();
}
// FIXME: This should not mutate the event.
if (shouldTurnVerticalTicksIntoHorizontal(result))
e.turnVerticalTicksIntoHorizontal();
......
......@@ -81,7 +81,7 @@ void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
}
}
bool ScrollAnimator::handleWheelEvent(PlatformWheelEvent& e)
bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
{
Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar();
......
......@@ -63,7 +63,7 @@ public:
virtual void setIsActive() { }
virtual bool handleWheelEvent(PlatformWheelEvent&);
virtual bool handleWheelEvent(const PlatformWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
virtual void handleGestureEvent(const PlatformGestureEvent&);
#endif
......
......@@ -797,7 +797,7 @@ void ScrollView::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle)
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)
......
......@@ -234,7 +234,7 @@ public:
// 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
......
......@@ -123,7 +123,7 @@ void ScrollableArea::scrollToYOffsetWithoutAnimation(float y)
scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), y));
}
bool ScrollableArea::handleWheelEvent(PlatformWheelEvent& wheelEvent)
bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
return scrollAnimator()->handleWheelEvent(wheelEvent);
}
......
......@@ -52,7 +52,7 @@ public:
void scrollToXOffsetWithoutAnimation(float x);
void scrollToYOffsetWithoutAnimation(float x);
bool handleWheelEvent(PlatformWheelEvent&);
bool handleWheelEvent(const PlatformWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
void handleGestureEvent(const PlatformGestureEvent&);
#endif
......
......@@ -59,7 +59,7 @@ public:
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
......
......@@ -781,7 +781,7 @@ static inline bool isScrollingRightAndShouldNotRubberBand(PlatformWheelEvent& wh
return wheelEvent.deltaX() < 0 && !scrollableArea->shouldRubberBandInDirection(ScrollRight);
}
bool ScrollAnimatorChromiumMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
bool ScrollAnimatorChromiumMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
m_haveScrolledSincePageLoad = true;
......
......@@ -62,7 +62,7 @@ public:
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 @@ private:
bool pinnedInDirection(float deltaX, float deltaY);
void snapRubberBand();
void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*);
void smoothScrollWithEvent(PlatformWheelEvent&);
void smoothScrollWithEvent(const PlatformWheelEvent&);
void beginScrollGesture();
void endScrollGesture();
......
......@@ -782,17 +782,17 @@ static float scrollWheelMultiplier()
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 @@ bool ScrollAnimatorMac::allowsHorizontalStretching() const
return false;
}
void ScrollAnimatorMac::smoothScrollWithEvent(PlatformWheelEvent& wheelEvent)
void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEvent)
{
m_haveScrolledSincePageLoad = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment