Bug 243373 - AX: An unnecessary group is created for every block-flow box with no other useful AX semantics
Summary: AX: An unnecessary group is created for every block-flow box with no other us...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
: 242779 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-07-30 10:38 PDT by Tyler Wilcock
Modified: 2022-08-26 00:04 PDT (History)
11 users (show)

See Also:


Attachments
Patch (52.98 KB, patch)
2022-07-30 11:13 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (53.58 KB, patch)
2022-07-30 11:24 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (51.93 KB, patch)
2022-07-30 11:36 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (69.89 KB, patch)
2022-08-01 11:58 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (73.32 KB, patch)
2022-08-01 15:33 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (73.56 KB, patch)
2022-08-01 18:19 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2022-07-30 10:38:17 PDT
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
Comment 1 Radar WebKit Bug Importer 2022-07-30 10:38:26 PDT
<rdar://problem/97840402>
Comment 2 Tyler Wilcock 2022-07-30 11:13:20 PDT
Created attachment 461307 [details]
Patch
Comment 3 Tyler Wilcock 2022-07-30 11:24:06 PDT
Created attachment 461308 [details]
Patch
Comment 4 Tyler Wilcock 2022-07-30 11:36:49 PDT
Created attachment 461309 [details]
Patch
Comment 5 chris fleizach 2022-07-30 12:31:46 PDT
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?
Comment 6 Tyler Wilcock 2022-08-01 11:58:23 PDT
Created attachment 461338 [details]
Patch
Comment 7 Tyler Wilcock 2022-08-01 12:00:59 PDT
(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 8 chris fleizach 2022-08-01 13:44:39 PDT
Comment on attachment 461338 [details]
Patch

there are still GTK failing tests for AX. not sure if related
Comment 9 Tyler Wilcock 2022-08-01 15:33:16 PDT
Created attachment 461342 [details]
Patch
Comment 10 Tyler Wilcock 2022-08-01 18:19:43 PDT
Created attachment 461347 [details]
Patch
Comment 11 EWS 2022-08-02 09:26:20 PDT
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].
Comment 12 Tyler Wilcock 2022-08-05 15:39:50 PDT
*** Bug 242779 has been marked as a duplicate of this bug. ***
Comment 13 felipe 2022-08-26 00:04:18 PDT
Improvet news