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

Unified Diff: ui/events/blink/input_handler_proxy.cc

Issue 2943133002: Async Wheel Event with only the first one cancellable behind a flag. (Closed)
Patch Set: failing tests fixed. Created 3 years, 6 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: ui/events/blink/input_handler_proxy.cc
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index 6ff1983d7139c16be4b7604726a8c80db40dea7f..7d78d0b668009ef2c329048123734fcccc7c930e 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -666,6 +666,24 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel(
CancelCurrentFling();
InputHandlerProxy::EventDisposition result = DROP_EVENT;
+
+ if (wheel_event.dispatch_type == WebInputEvent::kEventNonBlocking) {
+ // The first wheel event in the sequence should be cancellable.
+ DCHECK(wheel_event.phase != WebMouseWheelEvent::kPhaseBegan);
+
+ DCHECK(mouse_wheel_result_ != kEventDispositionUndefined);
+ result = static_cast<EventDisposition>(mouse_wheel_result_);
+
+ if (wheel_event.phase == WebMouseWheelEvent::kPhaseEnded ||
+ wheel_event.phase == WebMouseWheelEvent::kPhaseCancelled ||
+ wheel_event.momentum_phase == WebMouseWheelEvent::kPhaseEnded ||
+ wheel_event.momentum_phase == WebMouseWheelEvent::kPhaseCancelled) {
+ mouse_wheel_result_ = kEventDispositionUndefined;
+ }
+
+ return result;
dtapuska 2017/06/20 20:53:14 So should we really be sending back undefined? ie;
sahel 2017/06/21 18:09:59 Done. I changed it to follow the blocking path if
+ }
+
cc::EventListenerProperties properties =
input_handler_->GetEventListenerProperties(
cc::EventListenerClass::kMouseWheel);

Powered by Google App Engine
This is Rietveld 408576698