Bug 253513

Summary: AX: Consolidate the text() and stringValue() methods for static text, text control and password field objects.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: AccessibilityAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Andres Gonzalez
Reported 2023-03-07 07:15:18 PST
stringValue() should return text() for these types of objects.
Attachments
Patch (23.07 KB, patch)
2023-03-07 07:27 PST, Andres Gonzalez
no flags
Patch (23.19 KB, patch)
2023-03-07 18:14 PST, Andres Gonzalez
no flags
Patch (23.14 KB, patch)
2023-03-08 05:01 PST, Andres Gonzalez
no flags
Radar WebKit Bug Importer
Comment 1 2023-03-07 07:15:41 PST
Andres Gonzalez
Comment 2 2023-03-07 07:27:29 PST
Tyler Wilcock
Comment 3 2023-03-07 16:49:35 PST
Comment on attachment 465339 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=465339&action=review > COMMIT_MESSAGE:7 > +The implementation of the text() and stringValue() for these types of objects is fragmented between the AccessibilityNodeObject and AccessibilityRenderObject classes. This patches eliminates some duplicated code and makes it easier to determine what these methods are returning for these roles. Typo, "patches" should probably be "patch". > COMMIT_MESSAGE:8 > +As a byproduct, the patch remove ariaRoleAttributed() from the AXCoreObject interface since it is not actually needed there. Some code cleanup. Typos here. As a byproduct, the patch remove ariaRoleAttributed() Should maybe read: As a byproduct, the patch removes ariaRoleAttribute() > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2195 > + if (isPasswordField()) > + return passwordFieldValue(); I think you need to rebase — I changed this to be `isSecureField` and `secureFieldValue` in a recent patch. > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2198 > + // In the former case, go first for any alt text that may have been specified. Nitpick on this wording -- feel free to take it or leave it. // In the former case, go first for any alt text that may have been specified. // In the former case, prefer any alt text that may have been specified. > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2199 > + // If no alt text present, fallback to the inline static text case where textUnderElement is used. // If no alt text present // If no alt text is present
Andres Gonzalez
Comment 4 2023-03-07 18:14:58 PST
Andres Gonzalez
Comment 5 2023-03-07 18:19:14 PST
(In reply to Tyler Wilcock from comment #3) > Comment on attachment 465339 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=465339&action=review > > > COMMIT_MESSAGE:7 > > +The implementation of the text() and stringValue() for these types of objects is fragmented between the AccessibilityNodeObject and AccessibilityRenderObject classes. This patches eliminates some duplicated code and makes it easier to determine what these methods are returning for these roles. > > Typo, "patches" should probably be "patch". > > > COMMIT_MESSAGE:8 > > +As a byproduct, the patch remove ariaRoleAttributed() from the AXCoreObject interface since it is not actually needed there. Some code cleanup. > > Typos here. > > As a byproduct, the patch remove ariaRoleAttributed() > > Should maybe read: > > As a byproduct, the patch removes ariaRoleAttribute() > > > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2195 > > + if (isPasswordField()) > > + return passwordFieldValue(); > > I think you need to rebase — I changed this to be `isSecureField` and > `secureFieldValue` in a recent patch. > > > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2198 > > + // In the former case, go first for any alt text that may have been specified. > > Nitpick on this wording -- feel free to take it or leave it. > > // In the former case, go first for any alt text that may have been > specified. > // In the former case, prefer any alt text that may have been specified. > > > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2199 > > + // If no alt text present, fallback to the inline static text case where textUnderElement is used. > > // If no alt text present > // If no alt text is present All fixed. Sorry for my poor writing this morning.
Andres Gonzalez
Comment 6 2023-03-08 05:01:56 PST
chris fleizach
Comment 7 2023-03-08 16:01:32 PST
Comment on attachment 465357 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=465357&action=review > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:-754 > - if (isARIAStaticText()) { do we lose any functionality by removing this block of text?
Andres Gonzalez
Comment 8 2023-03-08 16:57:40 PST
(In reply to chris fleizach from comment #7) > Comment on attachment 465357 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=465357&action=review > > > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:-754 > > - if (isARIAStaticText()) { > > do we lose any functionality by removing this block of text? No because: - isARIAStaticText implies isStaticText - if isStataticText then we call AccessibilityNodeObject::text which now do the right thing for both ARIA static text and actual static text.
EWS
Comment 9 2023-03-09 05:06:58 PST
Committed 261424@main (56bd520fb3a3): <https://commits.webkit.org/261424@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 465357 [details].
Note You need to log in before you can comment on or make changes to this bug.