Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 15650dca0c8084852fa8d568ef75fb35c36f0073
      
https://github.com/WebKit/WebKit/commit/15650dca0c8084852fa8d568ef75fb35c36f0073
  Author: Tyler Wilcock <[email protected]>
  Date:   2024-04-10 (Wed, 10 Apr 2024)

  Changed paths:
    M LayoutTests/accessibility/internal-link-anchors2-expected.txt
    M LayoutTests/accessibility/ios-simulator/link-with-images-text-expected.txt
    M LayoutTests/accessibility/ios-simulator/link-with-images-text.html
    M LayoutTests/accessibility/listitem-title-expected.txt
    M 
LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt
    M 
LayoutTests/accessibility/mac/label-element-changing-children-string-value.html
    M LayoutTests/accessibility/render-counter-text.html
    M 
LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_name_from_content-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_text_node-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-display/accessibility/display-contents-role-and-label-expected.txt
    M LayoutTests/platform/glib/accessibility/css-content-attribute-expected.txt
    M 
LayoutTests/platform/glib/accessibility/generated-content-with-display-table-crash-expected.txt
    M LayoutTests/platform/glib/accessibility/render-counter-text-expected.txt
    M 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-display/accessibility/display-contents-role-and-label-expected.txt
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/AXLogger.cpp
    M Source/WebCore/accessibility/AccessibilityMathMLElement.h
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp

  Log Message:
  -----------
  AX: When constructing accessibility text, tokens should not unconditionally 
be separated by a space
https://bugs.webkit.org/show_bug.cgi?id=272194
rdar://problem/125935544

Reviewed by Andres Gonzalez.

When building textUnderElement, we used to unconditionally separate tokens with 
a space. This is
not the right behavior for every sequence of CSS display types. For example, 
for:

<button>foo<span>bar</span>baz</button>

We generate an accname of "foo bar baz", but it is rendered as "foobarbaz", and 
thus that is what
we should be exposing.

With this patch, we now only insert a space based on a few heuristics, namely:
  - The CSS display type
  - Whether the object is a control
  - Whether text was retrieved through non "raw text" means, e.g. via 
attribute: aria-label, alt, etc.

This fixes 16 WPT subtests. Other tests have been updated as well because they 
tested for incorrect
accnames, which are fixed with this patch. I have explicitly checked each one, 
and confirmed the new
behavior is more correct (it matches the rendering, unlike the old behavior).

* LayoutTests/accessibility/internal-link-anchors2-expected.txt:
* LayoutTests/accessibility/ios-simulator/link-with-images-text-expected.txt:
* LayoutTests/accessibility/ios-simulator/link-with-images-text.html:
* LayoutTests/accessibility/listitem-title-expected.txt:
* 
LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt:
* 
LayoutTests/accessibility/mac/label-element-changing-children-string-value.html:
* LayoutTests/accessibility/render-counter-text.html:
* 
LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_name_from_content-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/accname/name/comp_text_node-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-display/accessibility/display-contents-role-and-label-expected.txt:
* LayoutTests/platform/glib/accessibility/css-content-attribute-expected.txt:
* 
LayoutTests/platform/glib/accessibility/generated-content-with-display-table-crash-expected.txt:
* LayoutTests/platform/glib/accessibility/render-counter-text-expected.txt:
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/css/css-display/accessibility/display-contents-role-and-label-expected.txt:
* Source/WebCore/accessibility/AXCoreObject.h:
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AccessibilityMathMLElement.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::appendNameToStringBuilder):
(WebCore::displayTypeNeedsSpace):
(WebCore::needsSpaceFromDisplay):
(WebCore::shouldPrependSpace):
(WebCore::AccessibilityNodeObject::textUnderElement const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeProperties):
Drive-by fix to change PLATFORM(ATSPI) to USE(ATSPI). The former is not correct 
(it will not evaluate true for ATSPI
or any platform / configuration).

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to