Commit cbd63cb1 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Set parent on owned children

Fixes an apparent coding error to now mirror AXNodeObject::AddChildren(),
where the owned children correctly get a parent.

Note: the duplication between the 2 methods is disturbing, and the code
should be refactored to be less repetitive.

Bug: None
Change-Id: Ib6bbc20680cdfb017e417de073640742fa15349c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2092909Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749379}
parent 6f2f7971
...@@ -2184,6 +2184,9 @@ void AXLayoutObject::AddChildren() { ...@@ -2184,6 +2184,9 @@ void AXLayoutObject::AddChildren() {
AddValidationMessageChild(); AddValidationMessageChild();
AddAccessibleNodeChildren(); AddAccessibleNodeChildren();
for (const auto& owned_child : owned_children)
AddChild(owned_child);
for (const auto& child : children_) { for (const auto& child : children_) {
if (!is_continuation && !child->CachedParentObject()) { if (!is_continuation && !child->CachedParentObject()) {
// Never set continuations as a parent object. The first layout object // Never set continuations as a parent object. The first layout object
...@@ -2191,9 +2194,6 @@ void AXLayoutObject::AddChildren() { ...@@ -2191,9 +2194,6 @@ void AXLayoutObject::AddChildren() {
child->SetParent(this); child->SetParent(this);
} }
} }
for (const auto& owned_child : owned_children)
AddChild(owned_child);
} }
bool AXLayoutObject::CanHaveChildren() const { bool AXLayoutObject::CanHaveChildren() const {
......
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