GoogleChrome / accessibility-developer-tools

This is a library of accessibility-related testing and utility code.
Apache License 2.0
2.28k stars 363 forks source link

UnsupportedAriaAttribute will fail if getRoles returns null #239

Open dfreedm opened 9 years ago

dfreedm commented 9 years ago

This is because axs.constants.GLOBAL_PROPERTIES is an array, but supported is assumed to be a map and the attributeName in supported check will fail.

This is easy to reproduce with an element like <input type="text"> which has no role, at least according to axs.utils.getRole with the implicit flag set to true.

Maybe axs.constants.GLOBAL_PROPERTIES should have an equivalent property map, and that should be checked instead.

dfreedm commented 9 years ago

Relevant line: https://github.com/GoogleChrome/accessibility-developer-tools/blob/master/src/audits/UnsupportedAriaAttribute.js#L59