RESOLVED FIXED263736
AX: Add functionality to request AX clients to announce a given message to the user.
https://bugs.webkit.org/show_bug.cgi?id=263736
Summary AX: Add functionality to request AX clients to announce a given message to th...
Andres Gonzalez
Reported 2023-10-26 11:54:25 PDT
.
Attachments
Patch (4.87 KB, patch)
2023-10-26 13:45 PDT, Andres Gonzalez
no flags
Patch (6.92 KB, patch)
2023-10-27 09:23 PDT, Andres Gonzalez
no flags
Patch (11.83 KB, patch)
2023-10-30 12:07 PDT, Andres Gonzalez
no flags
Patch (20.05 KB, patch)
2023-10-31 09:01 PDT, Andres Gonzalez
ews-feeder: commit-queue-
Patch (20.04 KB, patch)
2023-10-31 10:16 PDT, Andres Gonzalez
no flags
Patch (20.23 KB, patch)
2023-10-31 12:43 PDT, Andres Gonzalez
no flags
Patch (21.84 KB, patch)
2023-11-01 06:45 PDT, Andres Gonzalez
no flags
Patch (21.91 KB, patch)
2023-11-01 08:25 PDT, Andres Gonzalez
no flags
Radar WebKit Bug Importer
Comment 1 2023-10-26 11:54:40 PDT
Andres Gonzalez
Comment 2 2023-10-26 13:45:33 PDT
chris fleizach
Comment 3 2023-10-26 14:19:06 PDT
Comment on attachment 468359 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=468359&action=review > Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:302 > +void AXObjectCache::announce(const String& message) can we also add the iOS version of this too
Andres Gonzalez
Comment 4 2023-10-27 09:23:27 PDT
Andres Gonzalez
Comment 5 2023-10-27 09:24:51 PDT
(In reply to chris fleizach from comment #3) > Comment on attachment 468359 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=468359&action=review > > > Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:302 > > +void AXObjectCache::announce(const String& message) > > can we also add the iOS version of this too Done, thanks.
chris fleizach
Comment 6 2023-10-27 09:38:36 PDT
Comment on attachment 468370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=468370&action=review > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:47 > + relayNotification(UIAccessibilityAnnouncementNotification, [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding]); For iOS, i think what we need to do is postPlatformNotification(object, AXAnnouncement); then add AXAnnouncement to enum AXNotification then we need to update ASCIILiteral AXObjectCache::notificationPlatformName(AXNotification notification) { to add the enum to string mapping
Andres Gonzalez
Comment 7 2023-10-27 10:31:54 PDT
(In reply to chris fleizach from comment #6) > Comment on attachment 468370 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=468370&action=review > > > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:47 > > + relayNotification(UIAccessibilityAnnouncementNotification, [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding]); > > For iOS, i think what we need to do is > > postPlatformNotification(object, AXAnnouncement); > > then add > > AXAnnouncement to > enum AXNotification > > > then we need to update > > ASCIILiteral AXObjectCache::notificationPlatformName(AXNotification > notification) > { > > to add the enum to string mapping This is intended for a message that is not associated with any object, so postPlatformNotification is not the path here. I'll change the AXNotification to platform notification name mapping.
chris fleizach
Comment 8 2023-10-27 10:52:55 PDT
(In reply to Andres Gonzalez from comment #7) > (In reply to chris fleizach from comment #6) > > Comment on attachment 468370 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=468370&action=review > > > > > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:47 > > > + relayNotification(UIAccessibilityAnnouncementNotification, [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding]); > > > > For iOS, i think what we need to do is > > > > postPlatformNotification(object, AXAnnouncement); > > > > then add > > > > AXAnnouncement to > > enum AXNotification > > > > > > then we need to update > > > > ASCIILiteral AXObjectCache::notificationPlatformName(AXNotification > > notification) > > { > > > > to add the enum to string mapping > > This is intended for a message that is not associated with any object, so > postPlatformNotification is not the path here. I'll change the > AXNotification to platform notification name mapping. interestingly, most of these notifications aren't associated with the user, but we need to pass these through the postPlatformNotification so that the webkit bundle can process the notifications correctly
Andres Gonzalez
Comment 9 2023-10-27 13:28:41 PDT
(In reply to chris fleizach from comment #8) > (In reply to Andres Gonzalez from comment #7) > > (In reply to chris fleizach from comment #6) > > > Comment on attachment 468370 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=468370&action=review > > > > > > > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:47 > > > > + relayNotification(UIAccessibilityAnnouncementNotification, [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding]); > > > > > > For iOS, i think what we need to do is > > > > > > postPlatformNotification(object, AXAnnouncement); > > > > > > then add > > > > > > AXAnnouncement to > > > enum AXNotification > > > > > > > > > then we need to update > > > > > > ASCIILiteral AXObjectCache::notificationPlatformName(AXNotification > > > notification) > > > { > > > > > > to add the enum to string mapping > > > > This is intended for a message that is not associated with any object, so > > postPlatformNotification is not the path here. I'll change the > > AXNotification to platform notification name mapping. > > interestingly, most of these notifications aren't associated with the user, > but we need to pass these through the postPlatformNotification so that the > webkit bundle can process the notifications correctly To go that path, we then need to modify - (void)accessibilityOverrideProcessNotification:(NSString *)notificationName { // This is overridden by the Accessibility system to post-process notifications. // When it is done, it will call back into handleNotificationRelayToChrome. } To take an additional NSString *message. Is that what you are proposing?
chris fleizach
Comment 10 2023-10-27 14:05:03 PDT
(In reply to Andres Gonzalez from comment #9) > (In reply to chris fleizach from comment #8) > > (In reply to Andres Gonzalez from comment #7) > > > (In reply to chris fleizach from comment #6) > > > > Comment on attachment 468370 [details] > > > > Patch > > > > > > > > View in context: > > > > https://bugs.webkit.org/attachment.cgi?id=468370&action=review > > > > > > > > > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:47 > > > > > + relayNotification(UIAccessibilityAnnouncementNotification, [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding]); > > > > > > > > For iOS, i think what we need to do is > > > > > > > > postPlatformNotification(object, AXAnnouncement); > > > > > > > > then add > > > > > > > > AXAnnouncement to > > > > enum AXNotification > > > > > > > > > > > > then we need to update > > > > > > > > ASCIILiteral AXObjectCache::notificationPlatformName(AXNotification > > > > notification) > > > > { > > > > > > > > to add the enum to string mapping > > > > > > This is intended for a message that is not associated with any object, so > > > postPlatformNotification is not the path here. I'll change the > > > AXNotification to platform notification name mapping. > > > > interestingly, most of these notifications aren't associated with the user, > > but we need to pass these through the postPlatformNotification so that the > > webkit bundle can process the notifications correctly > > To go that path, we then need to modify > > - (void)accessibilityOverrideProcessNotification:(NSString *)notificationName > { > // This is overridden by the Accessibility system to post-process > notifications. > // When it is done, it will call back into > handleNotificationRelayToChrome. > } > > To take an additional NSString *message. Is that what you are proposing? yea we will need to do that.
Andres Gonzalez
Comment 11 2023-10-30 12:07:12 PDT
Andres Gonzalez
Comment 12 2023-10-30 12:19:01 PDT
(In reply to chris fleizach from comment #10) > (In reply to Andres Gonzalez from comment #9) > > (In reply to chris fleizach from comment #8) > > > (In reply to Andres Gonzalez from comment #7) > > > > (In reply to chris fleizach from comment #6) > > > > > Comment on attachment 468370 [details] > > > > > Patch > > > > > > > > > > View in context: > > > > > https://bugs.webkit.org/attachment.cgi?id=468370&action=review > > > > > > > > > > > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:47 > > > > > > + relayNotification(UIAccessibilityAnnouncementNotification, [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding]); > > > > > > > > > > For iOS, i think what we need to do is > > > > > > > > > > postPlatformNotification(object, AXAnnouncement); > > > > > > > > > > then add > > > > > > > > > > AXAnnouncement to > > > > > enum AXNotification > > > > > > > > > > > > > > > then we need to update > > > > > > > > > > ASCIILiteral AXObjectCache::notificationPlatformName(AXNotification > > > > > notification) > > > > > { > > > > > > > > > > to add the enum to string mapping > > > > > > > > This is intended for a message that is not associated with any object, so > > > > postPlatformNotification is not the path here. I'll change the > > > > AXNotification to platform notification name mapping. > > > > > > interestingly, most of these notifications aren't associated with the user, > > > but we need to pass these through the postPlatformNotification so that the > > > webkit bundle can process the notifications correctly > > > > To go that path, we then need to modify > > > > - (void)accessibilityOverrideProcessNotification:(NSString *)notificationName > > { > > // This is overridden by the Accessibility system to post-process > > notifications. > > // When it is done, it will call back into > > handleNotificationRelayToChrome. > > } > > > > To take an additional NSString *message. Is that what you are proposing? > > yea we will need to do that. Done.
chris fleizach
Comment 13 2023-10-30 13:29:26 PDT
Comment on attachment 468413 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=468413&action=review > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:132 > + [rootObject()->wrapper() accessibilityPostedNotification:notificationName.get() userInfo:@{ notificationName.get() : nsMessage }]; this has to be changed somewhere as well. > Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:304 > + NSAccessibilityPostNotificationWithUserInfo(NSApp, NSAccessibilityAnnouncementRequestedNotification, @{ seems possible to add a test for this behavior.
Andres Gonzalez
Comment 14 2023-10-31 09:01:53 PDT
Andres Gonzalez
Comment 15 2023-10-31 09:03:39 PDT
(In reply to chris fleizach from comment #13) > Comment on attachment 468413 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=468413&action=review > > > Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm:132 > > + [rootObject()->wrapper() accessibilityPostedNotification:notificationName.get() userInfo:@{ notificationName.get() : nsMessage }]; > > this has to be changed somewhere as well. > > > Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:304 > > + NSAccessibilityPostNotificationWithUserInfo(NSApp, NSAccessibilityAnnouncementRequestedNotification, @{ > > seems possible to add a test for this behavior. Added test and consolidated iOS and MacOS implementations.
Andres Gonzalez
Comment 16 2023-10-31 10:16:55 PDT
chris fleizach
Comment 17 2023-10-31 10:27:02 PDT
Comment on attachment 468426 [details] Patch build error ERROR: symbol __ZN7WebCore13AXObjectCache8announceERKN3WTF6StringE Command PhaseScriptExecution failed with a nonzero exit code
chris fleizach
Comment 18 2023-10-31 10:27:03 PDT
Comment on attachment 468426 [details] Patch build error ERROR: symbol __ZN7WebCore13AXObjectCache8announceERKN3WTF6StringE Command PhaseScriptExecution failed with a nonzero exit code
chris fleizach
Comment 19 2023-10-31 10:27:09 PDT
build error ERROR: symbol __ZN7WebCore13AXObjectCache8announceERKN3WTF6StringE Command PhaseScriptExecution failed with a nonzero exit code
Andres Gonzalez
Comment 20 2023-10-31 12:43:34 PDT
Andres Gonzalez
Comment 21 2023-11-01 06:45:05 PDT
Created attachment 468441 [details] Patch Excluding test from platforms that don't implement announce.
Andres Gonzalez
Comment 22 2023-11-01 08:25:57 PDT
EWS
Comment 23 2023-11-02 13:28:32 PDT
Committed 270135@main (4f1f74a1f3c8): <https://commits.webkit.org/270135@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 468445 [details].
Note You need to log in before you can comment on or make changes to this bug.