Commit 6cb18a47 authored by andersca@apple.com's avatar andersca@apple.com

Remove PlatformWheelEvent::m_isAccepted

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: http://svn.webkit.org/repository/webkit/trunk@96633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bf874685
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.
......@@ -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;
}
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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"))
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
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
......
......@@ -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);
......
......@@ -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)
......
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