Commit 25701b62 authored by Mario Bianucci's avatar Mario Bianucci Committed by Commit Bot

Removing unnecessary DCHECK

This DCHECK is causing a small number of crashes, but I can't find
a reason for it to exist. As far as I can tell, it shouldn't hurt
anything if a ScrollBegan event comes through with 0 deltas. After
removing it, I tried scrolling via mouse wheel, touchpad, and touch
screen and all still worked fine. I also tried removing it and
changing both scroll_update.data.scroll_update.delta_x and
scroll_update.data.scroll_update.delta_y to 0 every time it entered
that block, and scrolling appeared just fine to my eye.

I moved the needs_update requirement to the if
statement to avoid extra work being done if kPhaseBegan mouse wheel
events come through with 0 deltas because I'm not sure how commonly
that occurs.

Bug: 1039911
Change-Id: I8e9590ef95dedd94830e6181322cd111e72b5b81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1995702
Commit-Queue: Mario Bianucci <mabian@microsoft.com>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#731829}
parent 7c4b4ac5
...@@ -210,10 +210,14 @@ void MouseWheelEventQueue::ProcessMouseWheelAck( ...@@ -210,10 +210,14 @@ void MouseWheelEventQueue::ProcessMouseWheelAck(
RecordLatchingUmaMetric(client_->IsWheelScrollInProgress()); RecordLatchingUmaMetric(client_->IsWheelScrollInProgress());
bool synthetic = event_sent_for_gesture_ack_->event.has_synthetic_phase; bool synthetic = event_sent_for_gesture_ack_->event.has_synthetic_phase;
if (event_sent_for_gesture_ack_->event.phase ==
blink::WebMouseWheelEvent::kPhaseBegan) { // Generally, there should always be a non-zero delta with kPhaseBegan
// Wheel event with phaseBegan must have non-zero deltas. // events. However, sometimes this is not the case and the delta in both
DCHECK(needs_update); // directions is 0. When this occurs, don't call SendScrollBegin because
// scroll direction is necessary in order to determine the correct scroller
// to target and latch to.
if (needs_update && event_sent_for_gesture_ack_->event.phase ==
blink::WebMouseWheelEvent::kPhaseBegan) {
send_wheel_events_async_ = true; send_wheel_events_async_ = true;
if (!client_->IsWheelScrollInProgress()) if (!client_->IsWheelScrollInProgress())
......
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