Hi Chromium-accessibility team,
Julie noticed that some ARIA attributes are never really interpreted by Chrome, they're just passed through as-is to assistive technology. The question is, why should we do extra work to parse them and have attributes for them, when we could just get them directly from the list of all html attributes on each node?
A couple of examples from this change are aria-grabbed, aria-dropeffect, and the "type" attribute in an <input> element, but there are potentially a lot more of these.
The current code is a mix of both approaches, but it'd probably better if we picked one approach and tried to be consistent. Here are the two alternatives:
1. Make everything an accessibility attribute and deprecate the use of HTML attributes in the accessibility tree.
2. Get rid of accessibility attributes we don't actually parse or interpret and have the platform-specific code get these attributes directly from the HTML attributes.
Here are some thoughts on these.
Arguments for #1:
* Right now we're storing all of the HTML of every node in the accessibility tree, but probably 90% of that is ignored by screen readers. We could save memory by stripping out attributes that are never used.
* The automation API should have full access to ARIA but we want it to be a "clean" API where it's clear exactly what attributes it has.
* We could add an optional flag to chrome://accessibility to add back the HTML attributes for developer debugging - i.e. AViewer and NVDA have options to dump the HTML of each node.
* If an attribute is initially just passed through but later becomes something we interpret or map to a new native API on one platform, it's more flexible.
Arguments for #2:
* Firefox just maps all aria- attributes directly to the IAccessible2 attributes, which is pretty simple and makes support for new ARIA attributes automatic. For example, adding aria-foo to an element automatically exposes it in Firefox.
* It requires too much code to implement support for something like aria-grabbed now (or aria-modal, something we should add soon) when all we're going to do is pass it through as-is on many platforms. We could simplify our code.
There are other approaches we could consider, like keeping a single master list somewhere of ARIA attributes to pass through. That could be a compromise between #1 and #2, so adding support for a new trivial ARIA attribute could be just adding one line of code.
To help answer the question, it might be worth looking into how much memory we're wasting storing the html_attributes in the AX tree now. Perhaps someone could do a before/after measurement by opening a large page with lots of elements and attributes but relatively little use of ARIA.
Thoughts?