Commit 854a6743 authored by Daniel Libby's avatar Daniel Libby Committed by Commit Bot

Remove callback for injected scroll gestures

With the additional logic to not inject scroll gestures when the
computed delta would not end up scrolling, we no longer receive
calls to our callback that contain overscroll data. We can remove the
dummy callback we were passing in to suppress the DCHECK in
QueuedWebInputEvent::HandledEvent.

We can also set the event as non-blocking as well since the only reason
it was set as blocking was to ensure our callback was present in the
event that overscroll data was propagated.

I looked into suppressing this further within Blink for scroll gestures
with scrollbar device, but the location at which the overscroll
notification is created only has access to ScrollData, which has no
device information.

The test at
fast/scrolling/scrollbars/scrollbar-button-gesture-target.html exercises
the codepaths that used to cause the DCHECK to be hit.

R=bokan@chromium.org, tdresser@chromium.org

Bug: 954007
Change-Id: Ida793c2b590704aa26f25734ef131160b017fd03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636859Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#665769}
parent 6fef4b71
......@@ -569,24 +569,10 @@ void RenderWidgetInputHandler::InjectGestureScrollEvent(
ui::LatencyInfo latency_info;
ui::WebScopedInputEvent web_scoped_gesture_event(gesture_event.release());
// We have an empty callback since sending gestures through the
// system can generate overscroll params - if the user holds down the
// mouse on one of the arrows the autoscroll timer continues to fire to
// support infinite scrollers.
// For scrollbar, we ignore overscroll params, as scrollbar doesn't
// participate in overscroll.
// TODO(dlibby): Change blink to not propagate overscroll for scrollbar
// gestures and remove this callback. Currently non-blocking events are
// set up such that the callback is not propagated into the event queue,
// and we DCHECK when overscroll data is passed to the event handler.
HandledEventCallback handled_event = base::BindOnce(
[](InputEventAckState, const ui::LatencyInfo& latency_info,
std::unique_ptr<ui::DidOverscrollParams> overscroll_params,
base::Optional<cc::TouchAction> touch_action) {});
widget_->GetInputEventQueue()->HandleEvent(
std::move(web_scoped_gesture_event), latency_info,
DISPATCH_TYPE_BLOCKING, INPUT_EVENT_ACK_STATE_NOT_CONSUMED,
std::move(handled_event));
DISPATCH_TYPE_NON_BLOCKING, INPUT_EVENT_ACK_STATE_NOT_CONSUMED,
HandledEventCallback());
}
}
......
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