-
Notifications
You must be signed in to change notification settings - Fork 137
Description
This question originates from @cookiecrook's feedback as part of ARIA IDL work: #2484 (comment).
HTML boolean attributes such as disabled, checked, required, etc. evaluate to true (the IDL attribute) when the content attribute is present with any value including the empty string, e.g.,:
<!-- inputElement.disabled is FALSE -->
<input type="checkbox">
<!-- inputElement.disabled is TRUE -->
<input type="checkbox" disabled>
<!-- inputElement.disabled is TRUE -->
<input type="checkbox" disabled="">
<!-- inputElement.disabled is TRUE -->
<input type="checkbox" disabled="foo"> ARIA attributes that are boolean-like, with possible values of true/false only, do not currently behave like HTML booleans, e.g.,:
<!-- inputElement.ariaRequired should be treated as "false" per spec -->
<input aria-required=""> Should/could ARIA boolean-like attributes behave like HTML? Besides webcompat, perhaps another reason we can't do this is because boolean-like ARIA attributes reflect as nullable DOMString? rather than a boolean IDL type (in fact most ARIA IDL attributes reflect as nullable DOMString?).
See related ARIA IDL PR #2484 for upcoming IDL changes to boolean-like ARIA attributes:
- aria-atomic
- aria-busy
- aria-disabled
- aria-expanded
- aria-hidden
- aria-modal
- aria-multiline
- aria-multiselectable
- aria-readonly
- aria-required
- aria-selected