-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Describe the change
In order to address #2156, @spectranaut /@smhigley /@aardrian suggested clarification in the spec of how to assign undefined for states and properties; namely, to clarify that undefined represents a value (e.g., aria-expanded=undefined) rather than a string (e.g., aria-expanded="undefined"). This change may also involve explicitly stating the absence of a value is equivalent to undefined.
It's unclear where this should be documented (perhaps Section 6.2 Characteristics of States and Properties).
Unconventional techniques for assigning an undefined value
There may need to be additional clarification on the following assignment methods:
- Empty string:
stateOrProperty = ""(this one is referenced in thearia-currentsection as being allowed via the empty string, i.e., "If the attribute is not present or its value is the empty string...") - Null:
stateOrProperty = null
Potentially erroneous spec examples of "undefined" string value
The following two undefined references use the string value which may be confusing and require updating:
When exposing as a platform API Boolean state:
For values of "" (empty string), "undefined" or no attribute present:
NOTE
As of ARIA 1.3, aria-hidden="false" is now synonymous with aria-hidden="undefined".
Validator testing of undefined vs. "undefined"
W3C HTML Validator shows the following parsing results when undefined is assigned as a value (stateOrProperty=undefined) vs. a string (stateOrProperty="undefined").
For states/properties that support explicit assignment of undefined:
| State/property | "undefined" string |
undefined value |
Tested elements |
|---|---|---|---|
aria-checked |
passes | passes | role="checkbox", role="radio" |
aria-current (may be missing undefined in its Values table, see #2176) |
fails | fails | <button>, <a>, role="button", role="link" |
aria-expanded |
passes | passes | <button>, <a>, role="button", role="link" |
aria-grabbed |
Not tested | Not tested | None (deprecated element) |
aria-hidden (very recently added as part of #2090) |
fails | fails | <button>, <a>, role="button", role="link" |
aria-orientation |
passes | passes | role="scrollbar", "role="slider", role="tablist" |
aria-pressed |
passes | passes | <button>, role="button" |
aria-selected |
passes | passes | role="tab" |
aria-multiselectable (may be missing undefined in its Values table, see #2176) |
fails | fails | role="tablist", role="listbox" |
Link to the version of the specification or documentation you were looking at
Link to documentation: https://w3c.github.io/aria
Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?
Yes.