Skip to content

Instantly share code, notes, and snippets.

@annevk
Created February 21, 2023 16:50
Show Gist options
  • Save annevk/2ffb664fd4c9b5070556866ae9a5a416 to your computer and use it in GitHub Desktop.
Save annevk/2ffb664fd4c9b5070556866ae9a5a416 to your computer and use it in GitHub Desktop.
Type analysis of ARIA attributes
This list skips those that are numeric (already done by Domenic) or element-reflecting (should be good, apart from the naming).
role: token list
* should use DOMString (not DOMString?)
ariaAtomic: (missing), "true", "false"
* should be an enumerated attribute with no missing or invalid value default, limited to only known values
* can continue to use DOMString? in that case
* confusingly says "false" is the default, despite that not really being the case
ariaAutoComplete: "inline", "list", "both", "none" (default)
* should be an enumerated attribute with a missing value default and invalid value default ("none"), limited to only known values
* should use DOMString as missing is equivalent to "none"
* should have been named ariaAutocomplete as autocomplete is a single word per HTML
ariaBrailleLabel, ariaBrailleRoleDescription: string
* these are not reflected at the moment, why?
* should use DOMString
ariaBusy: "true", "false" (default)
* see ariaAutoComplete, only difference is the values
ariaChecked: "false", "mixed", "true", "undefined" (default)
* see ariaAutoComplete, only difference is the values
ariaColIndexText: string
* should use DOMString
ariaCurrent: complex enumerated attribute
* should be an enumerated attribute with a missing value default and invalid value default, limited to only known values
* also requires certain values to map to other values, e.g., "undefined" is "false"
* should use DOMString
ariaDescription: string
* should use DOMString
ariaDisabled: (missing), "false", "true"
* see ariaAtomic
* "false" cannot be the default here as "true" inherits
ariaDropEffect
* skipped as it's deprecated
ariaExpanded: "false", "true", "undefined" (default)
* looks like it should be an enumerated attribute with a missing value default and invalid value default ("undefined"), limited to only known values
* looks like it should use DOMString therefore
ariaHasPopup: complex enumerated attribute
* see ariaCurrent
ariaHidden: "false", "true", "undefined" (default)
* see ariaExpanded
ariaInvalid: complex enumerated attribute
* see ariaCurrent
ariaKeyShortcuts, ariaLabel: string
* should use DOMString
ariaLive: "assertive", "off" (default), "polite"
* see ariaExpanded
To be finished once there's some feedback on the general idea.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment