Commit 314eabc1 authored by Navid Zolghadr's avatar Navid Zolghadr Committed by Commit Bot

Replace another mouse EventTarget with Element

Bug: 612456
Change-Id: Idefb93e48c6d99ea3927702d17280a2c82850fdb
Reviewed-on: https://chromium-review.googlesource.com/c/1405435Reviewed-by: default avatarHayato Ito <hayato@chromium.org>
Reviewed-by: default avatarElla Ge <eirage@chromium.org>
Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622037}
parent 6eb051d1
......@@ -674,7 +674,7 @@ WebInputEventResult PointerEventManager::SendMousePointerEvent(
if (fake_event)
return WebInputEventResult::kHandledSuppressed;
EventTarget* effective_target = GetEffectiveTargetForPointerEvent(
Element* effective_target = GetEffectiveTargetForPointerEvent(
pointer_event_target, pointer_event->pointerId());
if ((event_type == WebInputEvent::kPointerDown ||
......@@ -702,15 +702,15 @@ WebInputEventResult PointerEventManager::SendMousePointerEvent(
if (pointer_event->isPrimary() &&
!prevent_mouse_event_for_pointer_type_[ToPointerTypeIndex(
mouse_event.pointer_type)]) {
EventTarget* mouse_target = effective_target;
// Event path could be null if pointer event is not dispatched and
// that happens for example when pointer event feature is not enabled.
Element* mouse_target = effective_target;
// Event path could be null if the pointer event is not dispatched.
if (!event_handling_util::IsInDocument(mouse_target) &&
pointer_event->HasEventPath()) {
for (const auto& context :
pointer_event->GetEventPath().NodeEventContexts()) {
if (event_handling_util::IsInDocument(&context.GetNode())) {
mouse_target = &context.GetNode();
if (context.GetNode().IsElementNode() &&
event_handling_util::IsInDocument(&context.GetNode())) {
mouse_target = ToElement(&context.GetNode());
break;
}
}
......
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