I can share what I’ve found so far:
I found this API: ax_platform_node_mac.mm:PostAnnouncementNotification which typically gets called from code that looks like `GetViewAccessibility().AnnounceText()` to make voiceover announcements. However, this call doesn’t work in macPWAs.
While looking around, I discovered some work that my colleagues did that appear to hit the same issue when they worked on Window Controls Overlay.
native_browser_frame.h - Chromium Code Search which leads to the CR which discusses details regarding the issue:
Elly Fong-Jonesdoes this change imply that GetViewAccessibility().AnnounceText() does not work in PWA windows at all? should we have a DCHECK for people using it there?
Amanda Baker
GetViewAccessibility().AnnounceText() doesn't work on PWAs on Mac (due to app shim magic), but works as expected on Windows and Linux (I assume ChromeOS as well, but haven't tested it).
I'm not sure how to go about DCHECKing attempts to GetViewAccessibility() in the PWA+Mac scenario. I assume the right place to have that DCHECK is in ViewAXPlatformNodeDelegate[Mac]::AnnounceText(), but I don't know how to get the Browser* from a ViewAXPlatformNodeDelegate, to check if browser->type() == Browser::Type::TYPE_APP/TYPE_APP_POPUP. Do you have any suggestions on how to approach the DCHECK?
Elly Fong-Jones
Oh, ew - I didn't think about that. Even if we could get the Browser* there, it would be a big layering violation. I guess we can leave that DCHECK out.
I wonder if GetViewAccessibility().AnnounceText() should somehow check for a remote window and if so forward the announcement there? otherwise it seems we will have a bunch of missing announcements in PWAs and tracking them down (to add this kind of workaround) could turn into quite a hobby.
So in summary, I think voiceover announcements just don’t work in PWA and require the workaround that Amanda put in, but her workaround is not plumbed to all the places that make the announcements (i.e. live regions)
From: Marijn Kruisselbrink <m...@chromium.org>
Sent: Friday, November 18, 2022 9:15 AM
To: Christopher Cameron <ccam...@google.com>
Cc: Daniel Murphy <dmu...@chromium.org>; Stanley Hon <sta...@microsoft.com>; ccam...@chromium.org
Subject: [EXTERNAL] Re: macPWA accessibility - ARIA live region
You don't often get email from m...@chromium.org. Learn why this is important
I haven't really looked at any accessibility parts of the code yet, but if you can figure out how this works with normal nonPWA chrome windows, I should be able to help figure out why that fails for PWA windows and/or what we might be able to do to make it work...
On Fri, Nov 18, 2022 at 12:56 AM Christopher Cameron <ccam...@google.com> wrote:
Unfortunately I haven't worked in this area in a while, and things have largely paged out of my brain by now. Marijn is now covering this area.
At the time, I worked very closely with dmazzoni@ (because this is something far out of my general competence area), but they appear to have left. I'm not sure who the best contact is now.
On Thu, Nov 17, 2022 at 10:58 PM Daniel Murphy <dmu...@chromium.org> wrote:
Interesting! +Marijn Kruisselbrink as well.
On Wed, Nov 16, 2022 at 11:39 AM Stanley Hon <sta...@microsoft.com> wrote:
Hi Chris,
I work on PWAs at MSEdge, I’m working on an issue you may be familiar with – it appears related to these bugs you worked on:
https://monorail-prod.appspot.com/p/chromium/issues/detail?id=916923
https://monorail-prod.appspot.com/p/chromium/issues/detail?id=900846
Our observation is that ARIA live regions do not announce voiceover announcements within PWAs. In particular, when you trigger the “Go” action in the live region – it’s supposed to make a voiceover announcement but it does not do so in PWAs.
It’s important to note this seems to work perfectly fine in a normal nonPWA Chrome window.
Is there any additional context or potential approaches you can provide as to how we might be able to get this to work?
Thanks,
Stanley