Make it possible to get the computed ARIA role for a given Accessible
Categories
(Core :: Disability Access APIs, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox114 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
We want a simple way to expose the computed ARIA role. This will be used in WebDriver and Dev Tools.
Currently, Gecko has string roles, but many of them are different to ARIA role names. In addition, some roles map to a broader Gecko role and require info from elsewhere; e.g. landmarks map to roles::LANDMARK and you have to use the xml-roles object attribute to get the actual landmark. This is problematic for WebDriver (which expects ARIA roles as a standard). It's also confusing for web developers who use Dev Tools.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
IN addition to the landmark role (where Gecko maps multiple ARIA roles to a single Gecko role), there are cases where Gecko maps a single ARIA role to multiple Gecko roles depending on other things. For example, Gecko mapps ARIA role button to Gecko role PUSHBUTTON, TOGGLE_BUTTON or BUTTONMENU depending on states.
In my initial attempt at this, I modified the Gecko string roles in RoleMap.h to use ARIA role names wherever possible. For example, PUSHBUTTON got a string role of "button". Accessible::ComputedARIARole then had to deal with a bunch of exceptions. There were a few problems with this:
- For cases like button, we still needed role strings for "toggle button", etc. because they needed to be translatable separately from "button" for Android.
- There are some roles (e.g. INTERNAL_FRAME) that don't map to an ARIA role at all. We had no way of knowing that a string role wasn't a standard ARIA role, so we would just return "internal frame", etc. This probably isn't appropriate, since this is supposed to return standardised names.
- Our tests use the role strings when logging results. It's a bit confusing to have the role strings completely different in some cases to the role constants. We could fix this confusion by renaming our roles, but that's a much bigger lift.
So, I'm now mapping ARIA roles completely separately from our role strings.
Assignee | ||
Comment 2•2 years ago
|
||
This will soon be used to return standardized ARIA role names from a new function.
Assignee | ||
Comment 3•2 years ago
|
||
We will soon call LandmarkRole from a new function which returns an nsStaticAtom.
LandmarkRole always returns static atoms anyway, so formalize this.
Assignee | ||
Comment 4•2 years ago
|
||
This also exposes this via XPCOM.
This will be used by WebDriver and Dev Tools.
Assignee | ||
Comment 5•2 years ago
|
||
AccessibleNode isn't really standardized, but it makes sense to return standardized ARIA roles here rather than Gecko role strings.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
Backed out for causing multiple failures.
- Pushes with failures - wpt
- Failure Log
- Failure line: TEST-UNEXPECTED-PASS | /html-aam/roles.html | el-address - expected FAIL
- Pushes with failures - mochitests
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | accessible/tests/browser/role/browser_computedARIARole.js | computedARIARole for htmlTbody is correct - Got "group", expected "rowgroup"
Assignee | ||
Updated•2 years ago
|
Comment 9•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9397edd3365b
https://hg.mozilla.org/mozilla-central/rev/6d9cc86e46cf
https://hg.mozilla.org/mozilla-central/rev/8d9039a48146
Description
•