Remove PlatformWheelEvent::m_isAccepted
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 20:11:04 +0000 (20:11 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2011 20:11:04 +0000 (20:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69357

Reviewed by Darin Adler.

../WebCore:

Remove PlatformWheelEvent::m_isAccepted and all the getters/setters.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::handleGestureEvent):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::wheelEvent):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::handleWheelEvent):
* platform/chromium/PopupContainer.cpp:
(WebCore::PopupContainer::handleGestureEvent):
* platform/chromium/ScrollAnimatorChromiumMac.mm:
(WebCore::ScrollAnimatorChromiumMac::handleWheelEvent):
* platform/efl/PlatformWheelEventEfl.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::handleWheelEvent):
* platform/mac/WheelEventMac.mm:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/qt/WheelEventQt.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/wx/MouseWheelEventWx.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

../WebKit/chromium:

* src/WebInputEventConversion.cpp:
(WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
m_isAccepted has been removed.

* src/WebScrollbarImpl.cpp:
(WebKit::WebScrollbarImpl::onMouseWheel):
Just return the value of handleWheelEvent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96633 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/platform/PlatformWheelEvent.h
Source/WebCore/platform/ScrollAnimator.cpp
Source/WebCore/platform/chromium/PopupContainer.cpp
Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm
Source/WebCore/platform/efl/PlatformWheelEventEfl.cpp
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
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/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebInputEventConversion.cpp
Source/WebKit/chromium/src/WebScrollbarImpl.cpp

index 7e60c56..f6a94cd 100644 (file)
@@ -1,3 +1,38 @@
+2011-10-04  Anders Carlsson  <andersca@apple.com>
+
+        Remove PlatformWheelEvent::m_isAccepted
+        https://bugs.webkit.org/show_bug.cgi?id=69357
+
+        Reviewed by Darin Adler.
+
+        Remove PlatformWheelEvent::m_isAccepted and all the getters/setters.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::handleGestureEvent):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::wheelEvent):
+        * platform/PlatformWheelEvent.h:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::handleWheelEvent):
+        * platform/chromium/PopupContainer.cpp:
+        (WebCore::PopupContainer::handleGestureEvent):
+        * platform/chromium/ScrollAnimatorChromiumMac.mm:
+        (WebCore::ScrollAnimatorChromiumMac::handleWheelEvent):
+        * platform/efl/PlatformWheelEventEfl.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::handleWheelEvent):
+        * platform/mac/WheelEventMac.mm:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+        * platform/qt/WheelEventQt.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+        * platform/win/WheelEventWin.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+        * platform/wx/MouseWheelEventWx.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+
 2011-09-21  Cris Neckar  <cdn@chromium.org>
 
         Hold refptr to identified previous sibling within findPlaceForCounter.
index 9b60b4a..c37926d 100644 (file)
@@ -2176,32 +2176,22 @@ bool EventHandler::handleWheelEvent(PlatformWheelEvent& e)
         
         if (isOverWidget && target && target->isWidget()) {
             Widget* widget = toRenderWidget(target)->widget();
-            if (widget && passWheelEventToWidget(e, widget)) {
-                e.accept();
+            if (widget && passWheelEventToWidget(e, widget))
                 return true;
-            }
         }
 
         node = node->shadowAncestorNode();
-        if (node && !node->dispatchWheelEvent(e)) {
-            e.accept();
+        if (node && !node->dispatchWheelEvent(e))
             return true;
-        }
     }
 
 
-    // isAccepted can't be true here, because then we would already have returned from this function.
-    ASSERT(!e.isAccepted());
-
     // We do another check on the frame view because the event handler can run JS which results in the frame getting destroyed.
     view = m_frame->view();
     if (!view)
         return false;
     
-    bool handled = view->wheelEvent(e);
-    ASSERT(handled == e.isAccepted());
-
-    return handled;
+    return view->wheelEvent(e);
 }
     
 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEvent)
@@ -2251,7 +2241,7 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
         // FIXME: Replace this interim implementation once the above fixme has been addressed.
         IntPoint point(gestureEvent.position().x(), gestureEvent.position().y());
         IntPoint globalPoint(gestureEvent.globalPosition().x(), gestureEvent.globalPosition().y());
-        PlatformWheelEvent syntheticWheelEvent(point, globalPoint, gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEvent.deltaX() / tickDivisor, gestureEvent.deltaY() / tickDivisor, ScrollByPixelWheelEvent, /* isAccepted */ false, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey());
+        PlatformWheelEvent syntheticWheelEvent(point, globalPoint, gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEvent.deltaX() / tickDivisor, gestureEvent.deltaY() / tickDivisor, ScrollByPixelWheelEvent, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey());
         handleWheelEvent(syntheticWheelEvent);
         return true;
     }
index 08b1e08..7622935 100644 (file)
@@ -106,10 +106,7 @@ bool EventHandler::wheelEvent(NSEvent *event)
     CurrentEventScope scope(event);
 
     PlatformWheelEvent wheelEvent(event, page->chrome()->platformPageClient());
-    bool handled = handleWheelEvent(wheelEvent);
-
-    ASSERT(handled == wheelEvent.isAccepted());
-    return handled;
+    return handleWheelEvent(wheelEvent);
 }
 
 bool EventHandler::keyEvent(NSEvent *event)
index dd5ec7f..4c62dff 100644 (file)
@@ -92,7 +92,6 @@ namespace WebCore {
             , m_wheelTicksX(0)
             , m_wheelTicksY(0)
             , m_granularity(ScrollByPixelWheelEvent)
-            , m_isAccepted(false)
             , m_shiftKey(false)
             , m_ctrlKey(false)
             , m_altKey(false)
@@ -107,7 +106,7 @@ namespace WebCore {
         {
         }
 
-        PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranularity granularity, bool isAccepted, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
+        PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranularity granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
             : m_position(position)
             , m_globalPosition(globalPosition)
             , m_deltaX(deltaX)
@@ -115,7 +114,6 @@ namespace WebCore {
             , m_wheelTicksX(wheelTicksX)
             , m_wheelTicksY(wheelTicksY)
             , m_granularity(granularity)
-            , m_isAccepted(isAccepted)
             , m_shiftKey(shiftKey)
             , m_ctrlKey(ctrlKey)
             , m_altKey(altKey)
@@ -141,7 +139,6 @@ namespace WebCore {
 
         PlatformWheelEventGranularity granularity() const { return m_granularity; }
 
-        bool isAccepted() const { return m_isAccepted; }
         bool shiftKey() const { return m_shiftKey; }
         bool ctrlKey() const { return m_ctrlKey; }
         bool altKey() const { return m_altKey; }
@@ -154,9 +151,6 @@ namespace WebCore {
 
         bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
 
-        void accept() { m_isAccepted = true; }
-        void ignore() { m_isAccepted = false; }
-
         void turnVerticalTicksIntoHorizontal()
         {
             m_deltaX = m_deltaY;
@@ -214,7 +208,6 @@ namespace WebCore {
         float m_wheelTicksX;
         float m_wheelTicksY;
         PlatformWheelEventGranularity m_granularity;
-        bool m_isAccepted;
         bool m_shiftKey;
         bool m_ctrlKey;
         bool m_altKey;
index 2bc781a..819c982 100644 (file)
@@ -99,7 +99,6 @@ bool ScrollAnimator::handleWheelEvent(PlatformWheelEvent& e)
         || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
         || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
         || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) {
-        e.accept();
         handled = true;
         if (e.granularity() == ScrollByPageWheelEvent) {
             ASSERT(!e.deltaX());
@@ -115,7 +114,6 @@ bool ScrollAnimator::handleWheelEvent(PlatformWheelEvent& e)
             scroll(HorizontalScrollbar, ScrollByPixel, horizontalScrollbar->pixelStep(), -deltaX);
     }
 
-    ASSERT(e.isAccepted() == handled);
     return handled;
 }
 
index a0a5a8b..8e1b8e9 100644 (file)
@@ -309,7 +309,7 @@ bool PopupContainer::handleGestureEvent(const PlatformGestureEvent& gestureEvent
     case PlatformGestureEvent::DoubleTapType:
         break;
     case PlatformGestureEvent::ScrollUpdateType: {
-        PlatformWheelEvent syntheticWheelEvent(gestureEvent.position(), gestureEvent.globalPosition(), gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEvent.deltaX() / 120.0f, gestureEvent.deltaY() / 120.0f, ScrollByPixelWheelEvent, /* isAccepted */ false, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey());
+        PlatformWheelEvent syntheticWheelEvent(gestureEvent.position(), gestureEvent.globalPosition(), gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEvent.deltaX() / 120.0f, gestureEvent.deltaY() / 120.0f, ScrollByPixelWheelEvent, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey());
         handleWheelEvent(syntheticWheelEvent);
         return true;
     }
index acb4bf6..0d27bfc 100644 (file)
@@ -832,13 +832,11 @@ bool ScrollAnimatorChromiumMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
     if (m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_snapRubberBandTimer.isActive())) {
         if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
             m_ignoreMomentumScrolls = false;
-            wheelEvent.accept();
             return true;
         }
         return false;
     }
 
-    wheelEvent.accept();
     smoothScrollWithEvent(wheelEvent);
     return true;
 }
index f1ae3b8..64e5d83 100644 (file)
@@ -46,7 +46,6 @@ PlatformWheelEvent::PlatformWheelEvent(const Evas_Event_Mouse_Wheel* ev)
     : m_position(IntPoint(ev->canvas.x, ev->canvas.y))
     , m_globalPosition(IntPoint(ev->canvas.x, ev->canvas.y))
     , m_granularity(ScrollByPixelWheelEvent)
-    , m_isAccepted(false)
     , m_shiftKey(evas_key_modifier_is_set(ev->modifiers, "Shift"))
     , m_ctrlKey(evas_key_modifier_is_set(ev->modifiers, "Control"))
     , m_altKey(evas_key_modifier_is_set(ev->modifiers, "Alt"))
index d3c518c..e8827dd 100644 (file)
@@ -844,13 +844,11 @@ bool ScrollAnimatorMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
     if (m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_snapRubberBandTimer.isActive())) {
         if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
             m_ignoreMomentumScrolls = false;
-            wheelEvent.accept();
             return true;
         }
         return false;
     }
 
-    wheelEvent.accept();
     smoothScrollWithEvent(wheelEvent);
     return true;
 }
index 39ad60b..58c969d 100644 (file)
@@ -93,7 +93,6 @@ PlatformWheelEvent::PlatformWheelEvent(NSEvent* event, NSView *windowView)
     : m_position(pointForEvent(event, windowView))
     , m_globalPosition(globalPointForEvent(event))
     , m_granularity(ScrollByPixelWheelEvent)
-    , m_isAccepted(false)
     , m_shiftKey([event modifierFlags] & NSShiftKeyMask)
     , m_ctrlKey([event modifierFlags] & NSControlKeyMask)
     , m_altKey([event modifierFlags] & NSAlternateKeyMask)
index 223ecb4..f225955 100644 (file)
@@ -62,7 +62,6 @@ PlatformWheelEvent::PlatformWheelEvent(QGraphicsSceneWheelEvent* e)
     : m_position(e->pos().toPoint())
     , m_globalPosition(e->screenPos())
     , m_granularity(ScrollByPixelWheelEvent)
-    , m_isAccepted(false)
     , m_shiftKey(e->modifiers() & Qt::ShiftModifier)
     , m_ctrlKey(e->modifiers() & Qt::ControlModifier)
     , m_altKey(e->modifiers() & Qt::AltModifier)
@@ -82,7 +81,6 @@ PlatformWheelEvent::PlatformWheelEvent(QWheelEvent* e)
     : m_position(e->pos())
     , m_globalPosition(e->globalPos())
     , m_granularity(ScrollByPixelWheelEvent)
-    , m_isAccepted(false)
     , m_shiftKey(e->modifiers() & Qt::ShiftModifier)
     , m_ctrlKey(e->modifiers() & Qt::ControlModifier)
     , m_altKey(e->modifiers() & Qt::AltModifier)
index 6ae68a8..a02fb06 100644 (file)
@@ -66,8 +66,7 @@ static int verticalScrollLines()
 }
 
 PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, const FloatSize& delta, const FloatPoint& location)
-    : m_isAccepted(false)
-    , m_shiftKey(false)
+    : m_shiftKey(false)
     , m_ctrlKey(false)
     , m_altKey(false)
     , m_metaKey(false)
@@ -91,7 +90,6 @@ PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, const FloatSize& delta, const
 PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam, bool isMouseHWheel)
     : m_position(positionForEvent(hWnd, lParam))
     , m_globalPosition(globalPositionForEvent(hWnd, lParam))
-    , m_isAccepted(false)
     , m_shiftKey(wParam & MK_SHIFT)
     , m_ctrlKey(wParam & MK_CONTROL)
     , m_altKey(GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT)
index 2349251..236220c 100644 (file)
@@ -44,7 +44,6 @@ PlatformWheelEvent::PlatformWheelEvent(const wxMouseEvent& event, const wxPoint&
     , m_deltaY(event.GetWheelRotation() / event.GetWheelDelta())
     , m_wheelTicksX(m_deltaX)
     , m_wheelTicksY(m_deltaY)
-    , m_isAccepted(false)
     , m_directionInvertedFromDevice(false)
 {
     // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
index 14044d8..f64956f 100644 (file)
@@ -1,3 +1,18 @@
+2011-10-04  Anders Carlsson  <andersca@apple.com>
+
+        Remove PlatformWheelEvent::m_isAccepted
+        https://bugs.webkit.org/show_bug.cgi?id=69357
+
+        Reviewed by Darin Adler.
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
+        m_isAccepted has been removed.
+
+        * src/WebScrollbarImpl.cpp:
+        (WebKit::WebScrollbarImpl::onMouseWheel):
+        Just return the value of handleWheelEvent.
+
 2011-10-04  Yury Semikhatsky  <yurys@chromium.org>
 
         [Chromium] Web Inspector: save inspector state into single string instead of string map
index 7565885..619c923 100644 (file)
@@ -98,7 +98,6 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo
     m_deltaY = e.deltaY;
     m_wheelTicksX = e.wheelTicksX;
     m_wheelTicksY = e.wheelTicksY;
-    m_isAccepted = false;
     m_granularity = e.scrollByPage ?
         ScrollByPageWheelEvent : ScrollByPixelWheelEvent;
     m_shiftKey = (e.modifiers & WebInputEvent::ShiftKey);
index e574ccc..b5bad5b 100644 (file)
@@ -249,8 +249,7 @@ bool WebScrollbarImpl::onMouseWheel(const WebInputEvent& event)
 {
     WebMouseWheelEvent mousewheel = *static_cast<const WebMouseWheelEvent*>(&event);
     PlatformWheelEventBuilder platformEvent(m_scrollbar.get(), mousewheel);
-    m_group->handleWheelEvent(platformEvent);
-    return platformEvent.isAccepted();
+    return m_group->handleWheelEvent(platformEvent);
 }
 
 bool WebScrollbarImpl::onKeyDown(const WebInputEvent& event)