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

  Changed paths:
    A 
LayoutTests/accessibility/mac/text-search-auto-expands-revealable-elements-expected.txt
    A 
LayoutTests/accessibility/mac/text-search-auto-expands-revealable-elements.html
    M Source/WebCore/accessibility/AXCoreObject.cpp
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/AXLogger.cpp
    M Source/WebCore/accessibility/AXNotifications.h
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXSearchManager.cpp
    M Source/WebCore/accessibility/AXSearchManager.h
    M Source/WebCore/accessibility/AXUtilities.cpp
    M Source/WebCore/accessibility/AXUtilities.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/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h

  Log Message:
  -----------
  AX: Auto-expand details and hidden="until-found" elements containing search 
text provided in a AXUIElementsForSearchPredicate request
https://bugs.webkit.org/show_bug.cgi?id=298432
rdar://159913471

Reviewed by Joshua Hoffman.

If the user is searching for a specific string, as indicated by search text 
being present in a AXUIElementsForSearchPredicate
request, we should provide matches if said string is inside a collapsed details 
element or hidden="until-found" container,
making sure to expand them as well.

This gets a bit tricky in the case of the accessibility thread, which obviously 
cannot inherently synchronously expand
an element. This patch adds a new 
`performFunctionOnMainThreadAndWaitWithTimeout` function to attempt allow
the accessibility thread to attempt a synchronous action, but bail after a 
timeout if the main-thread is busy. We use
this to try to expand revealable elements synchronously, but if we can't, we'll 
continue on with the search.

If we do timeout trying to reveal a container, we won't perform any further 
synchronous trips to the main-thread for
the remainder of the search, with the assumption being that the main-thread is 
busy doing other things.

New property AXProperty::RevealableText is added and cached for text objects 
within an auto-revealable container. Another
property, AXProperty::IsHiddenUntilFoundContainer, is also added to indicate 
that we should search within the given object
for revealable text.

* 
LayoutTests/accessibility/mac/text-search-auto-expands-revealable-elements-expected.txt:
 Added.
* 
LayoutTests/accessibility/mac/text-search-auto-expands-revealable-elements.html:
 Added.
* Source/WebCore/accessibility/AXCoreObject.cpp:
(WebCore::AXCoreObject::revealableContainers):
(WebCore::AXCoreObject::detailsAncestor const):
* Source/WebCore/accessibility/AXCoreObject.h:
(WebCore::Accessibility::performFunctionOnMainThreadAndWaitWithTimeout):
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AXNotifications.h:
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleAttributeChange):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::updateIsolatedTree):
(WebCore::documentNeedsLayoutOrStyleRecalc): Deleted.
* Source/WebCore/accessibility/AXSearchManager.cpp:
(WebCore::AXSearchManager::revealHiddenMatchWithTimeout):
(WebCore::AXSearchManager::findMatchingObjectsInternal):
* Source/WebCore/accessibility/AXSearchManager.h:
(WebCore::AXSearchManager::lastRevealAttemptTimedOut):
(WebCore::AXSearchManager::setLastRevealAttemptTimedOut):
* Source/WebCore/accessibility/AXUtilities.cpp:
(WebCore::needsLayoutOrStyleRecalc):
* Source/WebCore/accessibility/AXUtilities.h:
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::revealAncestors):
(WebCore::AccessibilityNodeObject::isHiddenUntilFoundContainer const):
(WebCore::AccessibilityNodeObject::revealableText const):
* Source/WebCore/accessibility/AccessibilityNodeObject.h:
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::defaultObjectInclusion const):
* Source/WebCore/accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::revealAncestors):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperties):
(WebCore::convertToPropertyFlag):
(WebCore::createIsolatedObjectData):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::objectBecameIgnored):

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