Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2586133003: Remove PlatformWheelEvent and use WebMouseWheelEvent instead (Closed)
Patch Set: Address comments Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 9c31d0adbe7df075c725e6428901d554fc4df1a2..0e18bf87dc22d702c337b2fa3ab6f4e6e8c00bcc 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -88,7 +88,6 @@
#include "core/style/CursorData.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "platform/PlatformTouchEvent.h"
-#include "platform/PlatformWheelEvent.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/WindowsKeyboardCodes.h"
#include "platform/geometry/FloatPoint.h"
@@ -98,6 +97,7 @@
#include "platform/scroll/ScrollAnimatorBase.h"
#include "platform/scroll/Scrollbar.h"
#include "public/platform/WebInputEvent.h"
+#include "public/platform/WebMouseWheelEvent.h"
#include "wtf/Assertions.h"
#include "wtf/CurrentTime.h"
#include "wtf/PtrUtil.h"
@@ -1270,17 +1270,18 @@ WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(
}
WebInputEventResult EventHandler::handleWheelEvent(
- const PlatformWheelEvent& event) {
+ const WebMouseWheelEvent& event) {
#if OS(MACOSX)
// Filter Mac OS specific phases, usually with a zero-delta.
// https://crbug.com/553732
- // TODO(chongz): EventSender sends events with |PlatformWheelEventPhaseNone|,
+ // TODO(chongz): EventSender sends events with
+ // |WebMouseWheelEvent::PhaseNone|,
// but it shouldn't.
- const int kPlatformWheelEventPhaseNoEventMask =
- PlatformWheelEventPhaseEnded | PlatformWheelEventPhaseCancelled |
- PlatformWheelEventPhaseMayBegin;
- if ((event.phase() & kPlatformWheelEventPhaseNoEventMask) ||
- (event.momentumPhase() & kPlatformWheelEventPhaseNoEventMask))
+ const int kWheelEventPhaseNoEventMask = WebMouseWheelEvent::PhaseEnded |
+ WebMouseWheelEvent::PhaseCancelled |
+ WebMouseWheelEvent::PhaseMayBegin;
+ if ((event.phase & kWheelEventPhaseNoEventMask) ||
+ (event.momentumPhase & kWheelEventPhaseNoEventMask))
return WebInputEventResult::NotHandled;
#endif
Document* doc = m_frame->document();
@@ -1292,7 +1293,8 @@ WebInputEventResult EventHandler::handleWheelEvent(
if (!view)
return WebInputEventResult::NotHandled;
- LayoutPoint vPoint = view->rootFrameToContents(event.position());
+ LayoutPoint vPoint =
+ view->rootFrameToContents(flooredIntPoint(event.positionInRootFrame()));
HitTestRequest request(HitTestRequest::ReadOnly);
HitTestResult result(request, vPoint);

Powered by Google App Engine
This is Rietveld 408576698