Commit 749ab857 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Do not invalidate more children than necessary

Do not invalidate children all the way up to the unignored ancestor,
only invalidate a single node included in tree, either |this| or the
first ancestor included in the tree.

This is a precursor to fixing terrible performance loading large chat
rooms on chat.google.com, but it does not yet fix the issue nor
the related perf_tests. In order to fix that, it will be necessary
to include more nodes in the tree as well.

Bug: 1107988
Change-Id: I8a1f267a243ff1eda3d186e4c872eac75b40d792
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2383293
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803151}
parent a26cfab7
......@@ -3740,13 +3740,11 @@ void AXNodeObject::ChildrenChanged() {
// 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.
AXObject* node_to_update = this;
while (node_to_update) {
bool is_included =
!LastKnownIsIgnoredValue() || LastKnownIsIgnoredButIncludedInTreeValue();
AXObject* node_to_update = is_included ? this : ParentObjectIncludedInTree();
if (node_to_update) // Can be null, e.g. if <title> contents change.
node_to_update->SetNeedsToUpdateChildren();
if (!node_to_update->LastKnownIsIgnoredValue())
break;
node_to_update = node_to_update->ParentObjectIfExists();
}
// 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