At the end of AccessibilityRenderObject::determineAccessibilityRole, we have this logic: if (m_renderer->isRenderBlockFlow()) return m_renderer->isAnonymousBlock() ? AccessibilityRole::TextGroup : AccessibilityRole::Group; This causes us to create a group from every block-flow box that doesn't otherwise have any useful AX semantics. This is problematic because: 1. It makes the AX tree diverge from the DOM in a way that makes inserting node-only children (e.g. those with display:contents) at the right index in AccessibilityRenderObject::addNodeOnlyChildren hard or impossible 2. Causes wasted work for WebKit by having to created isolated objects for these unnecessary groups 3. Causes wasted work for AX clients who have to filter through these semantics-less groups
<rdar://problem/97840402>
Created attachment 461307 [details] Patch
Created attachment 461308 [details] Patch
Created attachment 461309 [details] Patch
Comment on attachment 461309 [details] Patch Have you noticed any adverse affects with VO? Was there any git blame info on when this was added?
Created attachment 461338 [details] Patch
(In reply to chris fleizach from comment #5) > Comment on attachment 461309 [details] > Patch > > Have you noticed any adverse affects with VO? I navigated some of the layout tests with VO and the behavior is the same vs. main. This is because VO was already doing work to avoid navigating these unnecessary groups. I also tested some real world webpages (Twitter, Facebook, CNN, Wikipedia) and all seem good after this change. > Was there any git blame info on when this was added? We originally started exposing every single block-flow box as groups here: https://github.com/WebKit/WebKit/commit/1dffe622a2d62916440f71673af65d805a30430b (AX: GTK: ARIA role is not respected on <p> <label> <div> and <form>) This patch added a GTK-only layout test (accessibility/gtk/aria-roles-unignored.html) testing that the `role` attribute is respected on all four of these elements. To prove we don't regress this behavior with this patch, I've ported this test to run on macOS and iOS, included with the latest patch.
Comment on attachment 461338 [details] Patch there are still GTK failing tests for AX. not sure if related
Created attachment 461342 [details] Patch
Created attachment 461347 [details] Patch
Committed 253038@main (2c57ad237b34): <https://commits.webkit.org/253038@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 461347 [details].
*** Bug 242779 has been marked as a duplicate of this bug. ***
Improvet news