AX: AXIsolatedObject::initializeAttributeData should compute AXAncestorFlags if they...
commit7c23869a14278b715e67130ad12dd11d86c2444a
authortyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jan 2022 21:04:10 +0000 (14 21:04 +0000)
committertyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jan 2022 21:04:10 +0000 (14 21:04 +0000)
treea1e22cf7bb82eba73058a7d23e42039f4a93288c
parent44bfec2e6354f76605ee4894ab201c64fc2d43ec
AX: AXIsolatedObject::initializeAttributeData should compute AXAncestorFlags if they are unexpectedly uninitialized
https://bugs.webkit.org/show_bug.cgi?id=235189

Reviewed by Andres Gonzalez.

Currently in AXIsolatedObject::initializeAttributeData, we don't store
any ancestor flags if they are unexpectedly uninitialized (i.e. we're
asked to initialize an isolated object for a live AX object that has
not been added to the live AX tree).

Rather than not storing flags and thus creating an isolated object
with incorrect properties, we should do a single traversal to initialize them.
We should have to do this very rarely since we generally expect to be
given live AX objects with initialized flags here (and debug ASSERT that this is the case).

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::computeAncestorFlagsWithTraversal const):
Added.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::Accessibility::enumerateAncestors):
Added.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
Compute ancestor flags with a single traversal if they are unexpected uninitialized.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp