[webkit-changes] [WebKit/WebKit] ac7dd8: AX: display:contents lists don't return the correc...

Tyler Wilcock noreply at github.com
Sun May 28 17:58:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac7dd8d670b156b61c63ed6c32b2308fb900ac7d
      https://github.com/WebKit/WebKit/commit/ac7dd8d670b156b61c63ed6c32b2308fb900ac7d
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-05-28 (Sun, 28 May 2023)

  Changed paths:
    M LayoutTests/accessibility/aria-visible-element-roles.html
    M LayoutTests/accessibility/display-contents-element-roles-expected.txt
    M LayoutTests/accessibility/display-contents-element-roles.html
    M LayoutTests/platform/glib/accessibility/aria-visible-element-roles-expected.txt
    M LayoutTests/platform/glib/accessibility/display-contents-element-roles-expected.txt
    M LayoutTests/platform/ios/accessibility/display-contents-element-roles-expected.txt
    M LayoutTests/platform/mac-wk1/accessibility/aria-visible-element-roles-expected.txt
    M LayoutTests/platform/mac-wk2/accessibility/aria-visible-element-roles-expected.txt
    M LayoutTests/platform/wpe/accessibility/aria-visible-element-roles-expected.txt
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AccessibilityList.cpp
    M Source/WebCore/accessibility/AccessibilityList.h
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/accessibility/AccessibilityNodeObject.h
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/accessibility/AccessibilityRenderObject.h

  Log Message:
  -----------
  AX: display:contents lists don't return the correct subrole
https://bugs.webkit.org/show_bug.cgi?id=256950
rdar://problem/109498423

Reviewed by Andres Gonzalez.

With this patch, any list-type element (ol, ul, dl, role="list", etc)
with display:contents will now properly be created as an
AccessibilityList instance rather than an AccessibilityNodeObject.

The significant effects of this are:
  1. The correct subrole is now computed for these elements, which is
     important because some ATs do change their behavior based on the
     various list subroles.
  2. These elements now use the AccessibilityList::determineAccessibilityRole()
     "is this an AX list or layout-only list" heuristics.

In support of #2, some tests had to be modified to have rendered list items in
order to still be considered lists.

We implement this by allowing the creation of AccessibilityList with only a node
instead of requiring a renderer.

The other, more significant change introduced in this patch is that many
AccessibilityRenderObject methods are now changed to fallback to the
corresponding AccessibilityNodeObject implementation when there is no
renderer rather than returning early.

This is required because we have many subclasses of AccessibilityRenderObject
that also need to support display:contents (AccessibilityList is one of these).
Making this change weakens our definition of AccessibilityRenderObject from
"should have a renderer" to "should have a renderer or a node".

* LayoutTests/platform/wpe/accessibility/aria-visible-element-roles-expected.txt:
* LayoutTests/platform/glib/accessibility/aria-visible-element-roles-expected.txt:
* LayoutTests/platform/glib/accessibility/display-contents-element-roles-expected.txt:
* LayoutTests/platform/ios/accessibility/display-contents-element-roles-expected.txt:
* LayoutTests/platform/mac-wk1/accessibility/aria-visible-element-roles-expected.txt:
* LayoutTests/accessibility/aria-visible-element-roles.html:
* LayoutTests/accessibility/display-contents-element-roles-expected.txt:
* LayoutTests/accessibility/display-contents-element-roles.html:
* LayoutTests/platform/mac-wk2/accessibility/aria-visible-element-roles-expected.txt:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::shouldCreateAccessibilityList):
(WebCore::AXObjectCache::createObjectFromRenderer):
(WebCore::createFromNode):
(WebCore::AXObjectCache::getOrCreate):
* Source/WebCore/accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::AccessibilityList):
(WebCore::AccessibilityList::create):
* Source/WebCore/accessibility/AccessibilityList.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::checkboxOrRadioRect const):
(WebCore::AccessibilityNodeObject::elementRect const):
(WebCore::AccessibilityNodeObject::addChildren):
(WebCore::AccessibilityNodeObject::canHaveChildren const):
(WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
* Source/WebCore/accessibility/AccessibilityNodeObject.h:
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::convertFrameToSpace const):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::firstChild const):
(WebCore::AccessibilityRenderObject::lastChild const):
(WebCore::AccessibilityRenderObject::previousSibling const):
(WebCore::AccessibilityRenderObject::nextSibling const):
(WebCore::AccessibilityRenderObject::parentObject const):
(WebCore::AccessibilityRenderObject::helpText const):
(WebCore::AccessibilityRenderObject::textUnderElement const):
(WebCore::AccessibilityRenderObject::node const):
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::boundingBoxRect const):
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityRenderObject::document const):
(WebCore::AccessibilityRenderObject::documentFrameView const):
(WebCore::AccessibilityRenderObject::addChildren):
(WebCore::AccessibilityRenderObject::checkboxOrRadioRect const): Deleted.
(WebCore::AccessibilityRenderObject::elementRect const): Deleted.
(WebCore::AccessibilityRenderObject::canHaveChildren const): Deleted.
* Source/WebCore/accessibility/AccessibilityRenderObject.h:

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




More information about the webkit-changes mailing list