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

Clean up input search fix

- Use clear order
- Avoid double calculation of parent

TBR=dmazzoni@chromium.org

Bug: None
Change-Id: Iddc27d27f33191d147c4ad1137e612ae05810a57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533578
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826587}
parent 8a4645bf
......@@ -3841,25 +3841,23 @@ void AXNodeObject::ChildrenChanged() {
if (!GetNode() && !GetLayoutObject())
return;
// Call SetNeedsToUpdateChildren on this node, and if this node is
// ignored, call it on each existing parent until reaching an unignored node,
// because unignored nodes recursively include all children of ignored
// nodes. This method is called during layout, so we need to be careful to
// only explore existing objects.
// Always update current object, in case it wasn't included in the tree but
// now is. In that case, the LastKnownIsIncludedInTreeValue() won't have been
// updated yet, so we can't use that. Unfortunately, this is not a safe time
// to get the current included in tree value, therefore, we'll play it safe
// and update the children in two places sometimes.
SetNeedsToUpdateChildren();
// If this node is not in the tree, update the children of the first ancesor
// that is included in the tree.
if (!LastKnownIsIncludedInTreeValue()) {
// The first object (this or ancestor) that is included in the tree is the
// one whose children may have changed.
// Can be null, e.g. if <title> contents change
if (ParentObjectIncludedInTree())
ParentObjectIncludedInTree()->SetNeedsToUpdateChildren();
if (AXObject* node_to_update = ParentObjectIncludedInTree())
node_to_update->SetNeedsToUpdateChildren();
}
// Also update the current object, in case it wasn't included in the tree but
// now is. In that case, the LastKnownIsIncludedInTreeValue() won't have been
// updated yet, so we can't use that. Unfortunately, this is not a safe time
// to get the current included in tree value, therefore, we'll play it safe
// and update the children in two places sometimes.
SetNeedsToUpdateChildren();
// If this node's children are not part of the accessibility tree then
// skip notification and walking up the ancestors.
......
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