Commit 2ed9605b authored by Hayato Ito's avatar Hayato Ito Committed by Commit Bot

Fix a bug in https://crrev.com/c/1272937, where event.target can be still null

Fix a bug in the previous CL, https://crrev.com/c/1272937, where event.target
can be null when GetElement() returns nullptr.

Bug: 892970, 893449, 902287
Change-Id: I7a08227d39117c2dc90fe720f0d6ffd62d9b2ea6
Reviewed-on: https://chromium-review.googlesource.com/c/1322177
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606884}
parent f3fe32fc
...@@ -1095,12 +1095,11 @@ bool AXObject::DispatchEventToAOMEventListeners(Event& event) { ...@@ -1095,12 +1095,11 @@ bool AXObject::DispatchEventToAOMEventListeners(Event& event) {
// that if it didn't previously exist it won't be part of the event path. // that if it didn't previously exist it won't be part of the event path.
AccessibleNode* target = GetAccessibleNode(); AccessibleNode* target = GetAccessibleNode();
if (!target) { if (!target) {
if (Element* element = GetElement()) { if (Element* element = GetElement())
target = element->accessibleNode(); target = element->accessibleNode();
if (!target)
return false;
}
} }
if (!target)
return false;
event.SetTarget(target); event.SetTarget(target);
// Capturing phase. // Capturing phase.
......
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