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

Unified Diff: content/common/input/web_input_event_traits.cc

Issue 1888163003: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: content/common/input/web_input_event_traits.cc
diff --git a/content/common/input/web_input_event_traits.cc b/content/common/input/web_input_event_traits.cc
index a25cf8ed2ba8a60f70832d3e410d70f65f18d35c..8445e71d7faa372f3f5fb0407662d9c7f2025699 100644
--- a/content/common/input/web_input_event_traits.cc
+++ b/content/common/input/web_input_event_traits.cc
@@ -111,9 +111,9 @@ void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) {
void ApppendEventDetails(const WebTouchEvent& event, std::string* result) {
StringAppendF(result,
- "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d,"
+ "{\n Touches: %u, DispatchType: %d, CausesScrolling: %d,"
" uniqueTouchEventId: %u\n[\n",
- event.touchesLength, event.cancelable,
+ event.touchesLength, event.dispatchType,
event.movedBeyondSlopRegion, event.uniqueTouchEventId);
for (unsigned i = 0; i < event.touchesLength; ++i)
ApppendTouchPointDetails(event.touches[i], result);
@@ -481,11 +481,15 @@ bool WebInputEventTraits::ShouldBlockEventStream(const WebInputEvent& event) {
case WebInputEvent::GestureTapCancel:
case WebInputEvent::GesturePinchBegin:
case WebInputEvent::GesturePinchEnd:
+ return false;
case WebInputEvent::TouchCancel:
+ DCHECK_NE(WebInputEvent::Blocking,
+ static_cast<const WebTouchEvent&>(event).dispatchType);
tdresser 2016/04/18 15:12:02 Why do we DCHECK here, but for no other event type
dtapuska 2016/04/18 19:19:33 This is a move of the dcheck that was in the input
return false;
case WebInputEvent::TouchStart:
case WebInputEvent::TouchEnd:
- return static_cast<const WebTouchEvent&>(event).cancelable;
+ return static_cast<const WebTouchEvent&>(event).dispatchType ==
+ WebInputEvent::Blocking;
default:
return true;
}

Powered by Google App Engine
This is Rietveld 408576698