Missing attributes
WilcoFiers opened this issue · 15 comments
I couldn't quite figure out if this was intentional or not, but three of the ARIA 1.1 props aren't defined (as in, they are listed in some of the roles, but they're not included in the ariaPropsMap
. It certainly doesn't seem intentional. The three props are aria-details
, aria-errormessage
and aria-describedat
.
The below snippet helps narrow down the three missing attributes.
const { roles, aria: props } = require('aria-query');
const propNames = Array.from(props).map(([key]) => key);
const allProps = Array.from(roles).reduce((out, [name, rule]) => {
return [...out, ...Object.keys(rule.props)];
}, []);
const undocumentedProps = allProps.filter(prop => !propNames.includes(prop));
console.log(undocumentedProps);
Output:
[ 'aria-details', 'aria-errormessage', 'aria-describeat' ]
cc @jessebeach
I knew that aria-errormessage
is missing. I didn't know about aria-details
and aria-describedat
. Thank you for pointing them out.
aria-describeat didn't make into aria 1.1 .... and it is not planned for the future.
aria-describedat
is listed in the DPUB roles.
the DPUB ARIA module spec includes only role definitions. It does not include states or properties.
All DPUB roles have the doc- prefix, not the aria- prefix, which is reserved for aria states and properties.
Sorry, I wasn't very clear there. I know how the DPUB ARIA module works. What I'm saying is that in aria-query, if you get the props that are available on the DPUB roles, you'll see the aria-describedat
property. It isn't actually part of the DPUB module, so that it's included in aria-query seems to be a bug.
Good point, @WilcoFiers .
As far as I know, the problem is
- definitions of aria-query are based on an old DPUB-ARIA working draft which incorporate states and props of an old WAI-ARIA 1.1 working drafts so that aria-query has aria-describedat,
- The latest DPUB-ARIA recommendation incorporates states and props of the latest WAI-ARIA 1.1 Recommendation so that both of them dropped aria-describedat.
I think, thus, definitions of aria-query should be updated to latest recommendations.
@WilcoFiers, @marcysutton what do you think about targeting this for the aXe Hackathon at CSUN?
@jessebeach what do you think is the level of effort for this? The time at the hackathon always goes by so fast.
I opened pull requests removing aria-describedat from dpub-aria, adding aria-details and adding double-checking tests.
I apologize that I didn't mention I've started working on this in the previous comment.
If you don't mind, could you review them and please let me know if there are any problems.
(Though I won't attend CSUN, the Hackathon must be fun 😄 .)
@kurosawa-takeshi I apologize for causing you extra work because this project lacks documentation. No one else was working on it but me at the start.
The files under src/etc
are generated by a script: node ./scripts/breakUpAriaJSON.js
. This script reads ./scripts/roles.json
and then generates all the files. You should edit roles.json with the correct values. The script does a lot of magic to figure out inheritance, dedupe props, etc.
I updated the README.
Yay tests!
@kurosawa-takeshi resolved this issue. Thank you! 💯