[webkit-changes] [WebKit/WebKit] cfe51e: AX: Comboboxes don't expose their linked objects c...

Joshua Hoffman noreply at github.com
Thu Jan 25 17:08:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cfe51e0a34f03d8db9e573f6ea104160f5208549
      https://github.com/WebKit/WebKit/commit/cfe51e0a34f03d8db9e573f6ea104160f5208549
  Author: Joshua Hoffman <jhoffman23 at apple.com>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    A LayoutTests/accessibility/combobox-linked-listbox-destroyed-expected.txt
    A LayoutTests/accessibility/combobox-linked-listbox-destroyed.html
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/accessibility/AXCoreObject.cpp
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/accessibility/AccessibilityNodeObject.h
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h

  Log Message:
  -----------
  AX: Comboboxes don't expose their linked objects correctly
https://bugs.webkit.org/show_bug.cgi?id=267754
rdar://problem/121242926

Reviewed by Chris Fleizach.

This patch resolves a bug that would cause comboboxes to not expose their linked objects
correctly.

That bug prevented ATs from properly navigating common combox patterns like the demos
provided on sites like the following:
* https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/
* https://webkit.org/blog-files/aria1.0/combobox_with_live_region_status.html

One reason that these comboboxes were "losing" their linked objects was due to the way we
currently handle replaced objects. After an object is replaced once, we wouldn't update the
m_nodeObjectMapping with the last AXID associated with a given node. This information is
critical to how we decide whether to update relations or not, so we were missing out on
critical relations updates, and not establishing controller/owner relationships properly.
To address this, we now update the m_nodeObjectMapping when new AX render objects are
created for the same node. We also now keep track of recently deleted relations, since
objects may be removed from relations due to their renderer being destroyed, and use this
to determine if a replaced object should result in re-calculating relations.

A test was added to verify that this behavior works for both aria-owns and aria-controls.

This patch also unifies several methods (linkedObjects, addRadioButtonGroupChildren, and
addRadioButtonGroupMembers) between live and isolated objects by moving them to AXCoreObject.
This not only permits constructing linkedObjects on the secondary thread from our cached
relations, but also allows linkedObjects to be more accurate, as it will be in lockstep
with the isolated tree's relations and not a separate property to update.

* LayoutTests/accessibility/combobox-linked-listbox-destroyed-expected.txt: Added.
* LayoutTests/accessibility/combobox-linked-listbox-destroyed.html: Added.
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/accessibility/AXCoreObject.cpp:
(WebCore::AXCoreObject::linkedObjects const):
(WebCore::AXCoreObject::appendRadioButtonDescendants const):
(WebCore::AXCoreObject::appendRadioButtonGroupMembers const):
* Source/WebCore/accessibility/AXCoreObject.h:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::cacheAndInitializeWrapper):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::updateIsolatedTree):
(WebCore::AXObjectCache::removeRelations):
(WebCore::AXObjectCache::updateRelationsIfNeeded):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::radioButtonGroup const):
(WebCore::AccessibilityNodeObject::isRadioInput const):
(WebCore::AccessibilityNodeObject::internalLinkElement const):
(WebCore::AccessibilityNodeObject::addRadioButtonGroupChildren const): Deleted.
(WebCore::AccessibilityNodeObject::addRadioButtonGroupMembers const): Deleted.
(WebCore::AccessibilityNodeObject::linkedObjects const): Deleted.
* Source/WebCore/accessibility/AccessibilityNodeObject.h:
* Source/WebCore/accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::observableObject const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperties):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:

Canonical link: https://commits.webkit.org/273542@main




More information about the webkit-changes mailing list