Commit ff8f4d20 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Add null check to AXNodeObject::ComputeAriaOwnsChildren after AOM change

In change r484950 (https://codereview.chromium.org/2967193003),
AXNodeObject::ComputeAriaOwnsChildren was modified to handle both
ARIA attributes and AOM properties.

The change resulted in calling AxObjectCache().UpdateAriaOwns() with an
empty vector in a case where it wasn't called before, and when calling it
on an element with no Node (like on an anonymous block, for example),
that led to a crash. Fix that by only calling it when GetNode() is valid.

Bug: 740375
Change-Id: I058c9760e600e3e582778788a12950cbbeeb77a9
Reviewed-on: https://chromium-review.googlesource.com/574765Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487978}
parent 891f788a
...@@ -2580,7 +2580,8 @@ void AXNodeObject::ComputeAriaOwnsChildren( ...@@ -2580,7 +2580,8 @@ void AXNodeObject::ComputeAriaOwnsChildren(
Vector<String> id_vector; Vector<String> id_vector;
if (!CanHaveChildren() || IsNativeTextControl() || if (!CanHaveChildren() || IsNativeTextControl() ||
HasContentEditableAttributeSet()) { HasContentEditableAttributeSet()) {
AxObjectCache().UpdateAriaOwns(this, id_vector, owned_children); if (GetNode())
AxObjectCache().UpdateAriaOwns(this, id_vector, owned_children);
return; return;
} }
......
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