-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARIA IDL updates: convert eligible attributes to enumerated, new ARIA IDL guidance and examples #2413
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…/false/undefined, tristate
…ibutes', and remove note referencing true/false
…quirement to not reflect missing/invalid value default
Adding this PR for discussion at the Feb 27 2025 ARIA WG meeting. |
@@ -99,10 +99,10 @@ caption{ | |||
margin:1em 0 0.1em; | |||
padding:0 0 0 0.3em; | |||
} | |||
table.role-features th, table.role-features td, table.state-features th, table.state-features td, table.property-features th, table.property-features td, table.value-descriptions th, table.value-descriptions td { | |||
table.role-features th, table.role-features td, table.state-features th, table.state-features td, table.property-features th, table.property-features td, table.value-descriptions th, table.value-descriptions td, table.state-descriptions th, table.state-descriptions td { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will cause a conflict with #2410. Could you use a respec class name instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI #2410 was merged - please undo this change when rebasing so we don't end up with "new" copy of common.css in the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rahimabdi I've left a couple of review notes which I think apply in a lot of places, but rather than inundating you with review comments hopefully you can take the couple here and pattern match across the rest of the spec.
<td class="value-description">Assistive technologies will present the entire changed region as a whole, including the author-defined label if one exists.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> and <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> are both the Missing state.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML has a concept of states that don't map to a keyword, but each state must have a definition, the definition allows mapping back to a keyword, or null. As an example the popover
attribute has a missing value default of no-popover state which let's the spec say things like "if the popover attribute is in the no-popover state".
Additionally, traditional enumerated attributes will map an invalid state back to a particular keyword; for example popover
's invalid attribute state is the manual
state, which maps to the keyword "manual"
. It's important to know what the invalid state maps back to because it determines what value is returned in the IDL for those values.
Note: not all missing values return null (e.g. the kind
attribute on <track>
elements has a missing value default of the subtitles state, so a track's .kind
property returns "subtitles"
even if the attribute is not present, another example is the type
attribute on <input>
which defaults to "text"
).
With that said it's possible to be in "no state". In fact, an enumerated attribute without a missing value default will be in "no state", as will invalid. No state, AIUI, will always map to null.
So here, the simplest thing for us to do here, rather than the implied missing state is to remove this, and lean on the lack of a missing/invalid state returning the no state. IOW this line could simply be removed:
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> and <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> are both the Missing state.</p> |
If you think missing the definitions create more ambiguity, then we can instead do something like:
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> and <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> are both the Missing state.</p> | |
<p>The attribute has no <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> or <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a>.</p> |
@@ -10826,6 +10849,7 @@ <h2>Definitions of States and Properties (all aria-* attributes)</h2> | |||
</tr> | |||
</tbody> | |||
</table> | |||
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> and <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> are both the Undefined state.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <tr>
for the "undefined"
keyword is missing a <th>
to name its state. In other words there should be a line above L10848 with <th class="state-description" scope="row">Undefined</th>
. (I cannot comment on L10848 sadly).
I don't think we want the missing value default here to return the Undefined state, that will mean the .ariaChecked
property will return "undefined"
when aria-checked
isn't on the element. I presume we want to return null
instead? Browsers currently return null, so missing should be "no state", i.e. removed:
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> and <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> are both the Undefined state.</p> | |
<p>The attribute has no <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> and its <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> are both the Undefined state.</p> |
</tr> | ||
</tbody> | ||
</table> | ||
<table class="value-descriptions"> | ||
<caption>Values:</caption> | ||
<thead> | ||
<tr> | ||
<th scope="col">Value</th> | ||
<th scope="col">Value (keyword)</th> | ||
<th scope="col">State</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a mix of tabs/spaces here.
<td class="value-description">Indicates the popup is a <rref>dialog</rref>.</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> is the Undefined state, and its <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> is the Menu state.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, here, the missing value default being the Undefined
state means .ariaHasPopup
will return "undefined"
which I don't think is desirable. Instead:
<p>The attribute's <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a> is the Undefined state, and its <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> is the Menu state.</p> | |
<p>The attribute has no <a data-cite="html/common-microsyntaxes.html#missing-value-default">missing value default</a>, and its <a data-cite="html/common-microsyntaxes.html#invalid-value-default">invalid value default</a> is the Menu state.</p> |
Discussed briefly in today's ARIA meeting: https://www.w3.org/2025/03/06-aria-minutes#cd2e |
@rahimabdi I'm unable to help since this is on your fork. This looks like it will be a bit messy - very sorry! |
@pkra Would it be easier to create a fresh branch from current main? I can re-do all of the updates and copy over the comments. |
@rahimabdi I suspect the answer is yes. Sorry again, also to @keithamus for creating additional review work. |
@pkra No worries, thanks! |
Closes #2281
Closes #2279
Test, Documentation and Implementation tracking
Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.
Preview | Diff