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

  Changed paths:
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AXTextMarker.cpp

  Log Message:
  -----------
  AX: In isolated tree mode, searching for text inside a user-select: none 
element returns an empty range
https://bugs.webkit.org/show_bug.cgi?id=323506
rdar://186746991

Reviewed by Chris Fleizach.

accessibility/mac/search-text-with-image-hang.html searches the web area for 
"WebKit", which
occurs inside a user-select: none element. In isolated tree mode, the result's 
marker range came
back empty.

The search runs on the main thread and produces a CharacterOffset, which has to 
be turned into
a position before it can be recorded. That conversion builds a VisiblePosition, 
and
canonicalization treats a position inside user-select: none as no candidate at 
all, so it moves
out of the element entirely.

Accessibility exposes the text of a user-select: none element (it is the 
element's AXValue)
so a marker has to be able to address it. Ask for a VisiblePosition that 
considers those
positions valid, the same way 318359@main did for the AT-SPI text APIs, which 
had this bug in a
different form. The new argument defaults to AllowUserSelectNone::No, so the 
roughly thirty
other callers of visiblePositionFromCharacterOffset are unaffected, though 
arguably should also
be changed in a later patch.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
Unskip the test.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/AXTextMarker.cpp:
(WebCore::TextMarkerData::TextMarkerData):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to