AX: AXIsolatedTree::updateChildren sometimes fails to update isolated subtrees when... master
authortyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2022 16:44:06 +0000 (16:44 +0000)
committertyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2022 16:44:06 +0000 (16:44 +0000)
commit6e6e90481e0783ca89e6e1bc8cc4c68c7a0a4b48
tree4997045b31dd699e5011bb28e5adde3ceffe28e7
parentdb93630b00d55066815ff717e86cd327077e0b35
AX: AXIsolatedTree::updateChildren sometimes fails to update isolated subtrees when the given live object is ignored
https://bugs.webkit.org/show_bug.cgi?id=241735

Reviewed by Andres Gonzalez.

Our current algorithm in AXIsolatedTree::updateChildren is:

  1. If the object we got an AXChildrenChanged notification
  for is in the isolated tree, update its isolated children

  2. Otherwise, ascend the ancestry to the nearest
  in-isolated-tree ancestor, and update the children of that
  object

This is not always adequate when the object passed to updateChildren
is ignored, as in some cases the ancestor has no children changes
but the subtrees of the ignored object do.

This patch fixes this by also checking the live-children of the ignored
object for any that have unitialized children. If so, we call
AXIsolatedTree::updateChildren on those too.

* Source/WebCore/accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::childrenInitialized const):
Move from private to public.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateChildren):

link: https://commits.webkit.org/251784@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h