Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e7d986a7c77c78d6ab265f0ebdf5a4f22b378059
      
https://github.com/WebKit/WebKit/commit/e7d986a7c77c78d6ab265f0ebdf5a4f22b378059
  Author: Tyler Wilcock <[email protected]>
  Date:   2025-05-02 (Fri, 02 May 2025)

  Changed paths:
    A LayoutTests/accessibility/mac/hidden-related-object-exposure-expected.txt
    A LayoutTests/accessibility/mac/hidden-related-object-exposure.html
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
    M Source/WebCore/accessibility/AccessibilityImageMapLink.h
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp

  Log Message:
  -----------
  AX: Named hidden elements are being announced with VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=292212
rdar://150219368

Reviewed by Joshua Hoffman.

With this commit, AccessibilityNodeObjects are now properly ignored when within 
display:none, visibility:hidden, and
content-visibility:hidden subtrees.

This required adding some overrides for objects that are known to be hidden by 
default via user-agent styles, but still
should be exposed — namely, AccessibilityImageMapLink and anything within a 
canvas subtree.

This change also exposed a bug in how we manage Text nodes that initially start 
in display:none subtrees. These Text
nodes don't have renderers, so we will create them as AccessibilityNodeObjects. 
But when they gain renderers, e.g.
because their containing element loses display:none, we never turned them into 
AccessibilityRenderObject. This is
critical, since the RenderText is how we get lots of information (e.g. style). 
This change exposed the failure
because now AccessibilityNodeObject::computeIsIgnored checks the style via 
isRenderHidden(), and because it was an
AccessibilityNodeObject subclass that wasn't an element, we always returned 
nullptr style, and thus always returned
isRenderHidden. This test that exposed this was 
accessibility/aria-controlled-table-row-visibility.html.

With this commit, we now replace AccessibilityNodeObjects from Text nodes when 
they gain a renderer.

* LayoutTests/accessibility/mac/hidden-related-object-exposure-expected.txt: 
Added.
* LayoutTests/accessibility/mac/hidden-related-object-exposure.html: Added.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::onRendererCreated):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::computeIsIgnored const):
* Source/WebCore/accessibility/AccessibilityImageMapLink.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::computeIsIgnored const):
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createTextRenderer):

Canonical link: https://commits.webkit.org/294470@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