[webkit-changes] [WebKit/WebKit] 942e4c: AX: The target element of an aria-labeledby relati...

AndresGonzalezApple noreply at github.com
Tue Dec 5 12:51:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 942e4cb41848f769b466cdd5ee3ceb00764670a4
      https://github.com/WebKit/WebKit/commit/942e4cb41848f769b466cdd5ee3ceb00764670a4
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2023-12-05 (Tue, 05 Dec 2023)

  Changed paths:
    M LayoutTests/accessibility/text-alternative-calculation-from-unrendered-table-expected.txt
    M LayoutTests/accessibility/text-alternative-calculation-from-unrendered-table.html
    M LayoutTests/platform/mac-wk1/TestExpectations
    M LayoutTests/platform/mac/accessibility/text-alternative-calculation-from-unrendered-table-expected.txt
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h

  Log Message:
  -----------
  AX: The target element of an aria-labeledby relation may not have an associated AX object created.
https://bugs.webkit.org/show_bug.cgi?id=265625
<rdar://problem/119013970>

Reviewed by Tyler Wilcock.

In the following example:

<button aria-labeledby="label"/> (1)
<span hidden id="label">z</span> (2)

We don't create an AX object that represents the element (2) since it is hidden. Other examples can be found in

    text-alternative-calculation-from-unrendered-table.html
and
    aria-labeled-with-hidden-node.html

ARIA specifies that we still have to expose (2) as the textual representation of (1). This creates a problem when attempting to fully implement LabeledBy relationships based on AX objects. This patch addresses the problem by unconditionally creating AX objects for elements that are targets of relationships.

* LayoutTests/accessibility/text-alternative-calculation-from-unrendered-table-expected.txt:
* LayoutTests/accessibility/text-alternative-calculation-from-unrendered-table.html: Modernized the code of this test.
* LayoutTests/platform/mac/accessibility/text-alternative-calculation-from-unrendered-table-expected.txt:
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::addRelation):
(WebCore::AXObjectCache::isDescendantOfRelationTarget):
* Source/WebCore/accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::getOrCreate):

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




More information about the webkit-changes mailing list