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

Unified Diff: third_party/WebKit/Source/web/WebInputEventConversion.cpp

Issue 1888163003: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and non-const ref passed back Created 4 years, 8 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/web/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index cb365e102de935bc9961cfa352bae245de12dd87..b53c4e6697c8c5cf5387450a4c829e5e32a20145 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -91,6 +91,20 @@ FloatPoint convertHitPointToRootFrame(const Widget* widget, FloatPoint pointInRe
(pointInRendererViewport.y() - offset.height()) / scale + visualViewport.y() + overscrollOffset.height());
}
+PlatformEvent::DispatchType toPlatformDispatchType(WebInputEvent::DispatchType type)
+{
+ static_assert(PlatformEvent::DispatchType::Blocking == static_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::Blocking),
+ "Dispatch Types not equal");
+ static_assert(PlatformEvent::DispatchType::EventNonBlocking == static_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::EventNonBlocking),
+ "Dispatch Types not equal");
+ static_assert(PlatformEvent::DispatchType::ListenersNonBlockingPassive == static_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::ListenersNonBlockingPassive),
+ "Dispatch Types not equal");
+ static_assert(PlatformEvent::DispatchType::ListenersForcedNonBlockingPassive == static_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::ListenersForcedNonBlockingPassive),
+ "Dispatch Types not equal");
+
+ return static_cast<PlatformEvent::DispatchType>(type);
+}
+
unsigned toPlatformModifierFrom(WebMouseEvent::Button button)
{
if (button == WebMouseEvent::ButtonNone)
@@ -459,7 +473,7 @@ PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo
for (unsigned i = 0; i < event.touchesLength; ++i)
m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touches[i]));
- m_cancelable = event.cancelable;
+ m_dispatchType = toPlatformDispatchType(event.dispatchType);
}
static FloatPoint convertAbsoluteLocationForLayoutObjectFloat(const LayoutPoint& location, const LayoutObject& layoutObject)
@@ -719,7 +733,7 @@ WebTouchEventBuilder::WebTouchEventBuilder(const LayoutObject* layoutObject, con
timeStampSeconds = event.platformTimeStamp();
modifiers = event.modifiers();
- cancelable = event.cancelable();
+ dispatchType = event.cancelable() ? WebInputEvent::Blocking : WebInputEvent::EventNonBlocking;
movedBeyondSlopRegion = event.causesScrollingIfUncanceled();
// Currently touches[] is empty, add stationary points as-is.
« no previous file with comments | « third_party/WebKit/Source/web/WebInputEvent.cpp ('k') | third_party/WebKit/Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698