Commit 75e5f733 authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

[VizHitTesting] Fix an unchecked access to a optional value

target_location has a value only if the target exists. When it doesn't
we early exit the DispatchMouseEvent(). In addition, we should skip
setting the mouse_down_post_transformed_coordinate_.

Bug: 985692
Change-Id: I4cd4dad3b1caefaf2bd7e81660e257a4bdb5fdfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715227
Commit-Queue: Yi Gu <yigu@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680119}
parent 99622283
......@@ -1828,7 +1828,7 @@ void RenderWidgetHostInputEventRouter::DispatchEventToTarget(
if (target && target->ScreenRectIsUnstableFor(event))
event.SetTargetFrameMovedRecently();
if (blink::WebInputEvent::IsMouseEventType(event.GetType())) {
if (event.GetType() == blink::WebInputEvent::kMouseDown) {
if (target && event.GetType() == blink::WebInputEvent::kMouseDown) {
mouse_down_post_transformed_coordinate_.SetPoint(target_location->x(),
target_location->y());
last_mouse_down_target_ = target;
......
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