Bug 254468

Summary: AX: VoiceOver not reading entered text in text fields.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: AccessibilityAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, darin, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Andres Gonzalez 2023-03-25 13:54:40 PDT
Fallout from https://bugs.webkit.org/show_bug.cgi?id=252193.
Comment 1 Radar WebKit Bug Importer 2023-03-25 13:54:49 PDT
<rdar://problem/107226245>
Comment 2 Andres Gonzalez 2023-03-25 13:56:22 PDT
rdar://106958414
Comment 3 Radar WebKit Bug Importer 2023-03-25 13:56:30 PDT
<rdar://problem/107226275>
Comment 4 Andres Gonzalez 2023-03-25 14:00:03 PDT
Created attachment 465591 [details]
Patch
Comment 5 chris fleizach 2023-03-25 14:24:56 PDT
Comment on attachment 465591 [details]
Patch

Good nuance to remember that apparently these ax attributes strings need CGcolors instead of NSColors

Thanks!
Comment 6 Andres Gonzalez 2023-03-26 09:26:08 PDT
Created attachment 465596 [details]
Patch
Comment 7 Darin Adler 2023-03-26 09:31:06 PDT
> The cause of the problem was that we were setting the color attribute in the AttributedString using the NSColor pointer that is not retained after the caller of this function returns

This explanation doesn’t make sense. Attributed strings retain the attributes, so the NSColor should be retained by the attributed string. There must be something else going on.
Comment 8 chris fleizach 2023-03-26 10:18:56 PDT
(In reply to Darin Adler from comment #7)
> > The cause of the problem was that we were setting the color attribute in the AttributedString using the NSColor pointer that is not retained after the caller of this function returns
> 
> This explanation doesn’t make sense. Attributed strings retain the
> attributes, so the NSColor should be retained by the attributed string.
> There must be something else going on.

I talked to andres offline. This explanation isn't right. The problem was that AX system expects cgcolors instead of nscolors. Andres can you update the message
Comment 9 EWS 2023-03-26 10:24:25 PDT
Committed 262126@main (ae7bf78d3f4f): <https://commits.webkit.org/262126@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 465596 [details].
Comment 10 Andres Gonzalez 2023-03-26 14:20:54 PDT
(In reply to Darin Adler from comment #7)
> > The cause of the problem was that we were setting the color attribute in the AttributedString using the NSColor pointer that is not retained after the caller of this function returns
> 
> This explanation doesn’t make sense. Attributed strings retain the
> attributes, so the NSColor should be retained by the attributed string.
> There must be something else going on.

Corrected the code comment in https://bugs.webkit.org/show_bug.cgi?id=254486. Thanks for pointing out.