Bug 269072

Summary: AX: WebKit fails to emit newlines between container nodes when serving AXStringForTextMarkerRange off the main-thread
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jhoffman23, mifenton, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch none

Tyler Wilcock
Reported 2024-02-09 09:16:26 PST
...
Attachments
Patch (27.76 KB, patch)
2024-02-09 10:42 PST, Tyler Wilcock
ews-feeder: commit-queue-
Patch (27.80 KB, patch)
2024-02-09 10:50 PST, Tyler Wilcock
no flags
Radar WebKit Bug Importer
Comment 1 2024-02-09 09:16:36 PST
Tyler Wilcock
Comment 2 2024-02-09 10:42:01 PST
Tyler Wilcock
Comment 3 2024-02-09 10:50:15 PST
Joshua Hoffman
Comment 4 2024-02-09 11:54:17 PST
Comment on attachment 469797 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=469797&action=review > Source/WebCore/accessibility/AXTextMarker.cpp:414 > + if (isForward) { > + for (size_t i = startIndex; i > endIndex; i--) > + append(children.at(i - 1)); This feels counter-intuitive to me (or may need a comment explaining)—why do we traverse backward in the children when appending the children when isForward == true?
Tyler Wilcock
Comment 5 2024-02-14 13:29:10 PST
(In reply to Joshua Hoffman from comment #4) > Comment on attachment 469797 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=469797&action=review > > > Source/WebCore/accessibility/AXTextMarker.cpp:414 > > + if (isForward) { > > + for (size_t i = startIndex; i > endIndex; i--) > > + append(children.at(i - 1)); > > This feels counter-intuitive to me (or may need a comment explaining)—why do > we traverse backward in the children when appending the children when > isForward == true? This is a good question. I think traversing forward would be fine, but this bit is copied exactly from AccessibilityObject::appendChildrenToArray, so I think it makes sense to keep consistent. These functions differ for now, but once all of this text-marker logic is not specific to AXIsolatedObject, we may want to share the original AccessibilityObject::appendChildrenToArray implementation, so want to keep similarities where we can to make that more straightforward.
EWS
Comment 6 2024-02-14 14:41:27 PST
Committed 274664@main (53c3857f5cea): <https://commits.webkit.org/274664@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 469797 [details].
Note You need to log in before you can comment on or make changes to this bug.