[Webkit-unassigned] [Bug 234841] AX: Make more tests async to pass in isolated tree mode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 5 07:10:14 PST 2022


--- Comment #6 from Carlos Garcia Campos <cgarcia at igalia.com> ---
I've analyzed in more detail what happens. Let's use a simple test as an example, like accessibility/language-attribute.html.

1- AccessibilityController::focusedElement() is called, when getting the root element the axObjectCache creates the isolated tree:
2- AXIsolatedTree::generateSubtree() is called for the root object, that already has one child, the web area.
 2.1-  AXIsolatedTree::createSubtree is called for the root object.
 2.2- AXIsolatedTree::createSubtree is called for the web area, but web area childrenCount is 0 a this point.
 2.3- AXIsolatedTree::generateSubtree() finished with 2 pending children updates
3- AccessibilityController::focusedElement() returns the web area element
4- AccessibilityUIElement::childAtIndex(0) is called on web area element
 4.1- executeOnAXThreadAndWait() is called to get the element first child
 4.2- On the main thread update backing store is called, so AXIsolatedTree::applyPendingChanges() is called and the 2 pending children updates are processed
 4.3- AXIsolatedObject::children() is called on web area element, and returns an empty array, so nullptr is returned as child.
 4.4- AXObjectCache::notificationPostTimerFired is called on the main thread (executeOnAXThreadAndWait iterates the main thread while waiting for the ax thread to complete the task), and that calls AXObjectCache::updateIsolatedTree() that ends up calling AXIsolatedTree::updateChildren() and now is when the rest of the isolated tree is populated, but it's too late because the ax thread already returned nullptr for the child.

The test fails with:

CONSOLE MESSAGE: TypeError: null is not an object (evaluating 'accessibilityObject.childrenCount')

accessibilityObject is webArea.childAtIndex(0) for which we returned null. 

This is what I tried to fix in bug #232141 by notifying about children changed earlier.

I can try other solutions like processing main thread loop also before going to the ax thread.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220105/223b59a5/attachment.htm>

More information about the webkit-unassigned mailing list