-
Notifications
You must be signed in to change notification settings - Fork 138
ARIA IDL updates: enumerated attribute conversions, new "enumerated" wai-aria type, IDL examples #2484
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
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 project configuration. |
Thanks! I'll review those comments (which are migrated to this PR now) and respond. |
Re-added reviewers @pkra @spectranaut @cookiecrook @keithamus @scottaohara. |
CC @pkra @spectranaut @cookiecrook @keithamus @scottaohara @annevk This PR is ready for review! I've made a number of updates, mainly:
If helpful, I also created this tool to simulate how the new ARIA IDL works for enumerated attributes: https://rahimabdi.github.io/aria-idl-simulator/. |
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.
One thing that's nice in HTML is that all the states are a <dfn>
and therefore also can be linked. But maybe that's best addressed in a follow-up.
index.html
Outdated
Some ARIA attributes support an Undefined state, which is equivalent to having no state (i.e., null). User agent implementations may omit the Undefined state since the lack of an explicit | ||
state results in the same behavior. For more information about determining the state of enumerated attributes, see |
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.
I think this sentence adds more confusion than it resolves. Especially since you cannot just leave it out at the moment without hitting an assert.
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.
Part of this could be an informative note for authors/implementors, rather than in the normative text of the Enumerated Attribute definition.
Do we ever anticipate a time where the explicit "undefined" content attribute values would need to map to an Undefined state, separately than the Null state? For example, I think the only scenarios where an undefined
is allowed are with the undefined/true/false/[/mixed]
enumerated values, but since the Missing Default and Invalid Default are the same one those, there is no impact... Can we foresee any scenario where those would be different? For example, if undefined
was an allowed token value of aria-invalid
? (Presumably we just need to always avoid that, which seems okay.)
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.
See @keithamus' related comment in https://github.com/w3c/aria/pull/2484/files#r2084175913
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.
@annevk @cookiecrook Got it, I've removed this sentence: "User agent implementations may omit the Undefined state since the lack of an explicit state results in the same behavior."
@keithamus Hopefully the link to the HTML spec (which defines the state computation algorithm) is sufficient.
Do we ever anticipate a time where the explicit "undefined" content attribute values would need to map to an Undefined state, separately than the Null state? For example, I think the only scenarios where an undefined is allowed are with the undefined/true/false/[/mixed] enumerated values, but since the Missing Default and Invalid Default are the same one those, there is no impact... Can we foresee any scenario where those would be different? For example, if undefined was an allowed token value of aria-invalid? (Presumably we just need to always avoid that, which seems okay.)
As @keithamus also mentioned, the "undefined" content attribute value will map to the invalid value default (effectively treated as invalid), and fortunately there's no need for any ARIA attribute to have an explicit "undefined" keyword (nor an Undefined state mapping to "undefined" the keyword). I plan to add a note on this in this PR.
Here are all the attributes which currently support a value of "undefined" per spec, all mapping to their respective invalid value defaults and equivalent with behavior currently defined in spec:
- aria-checked ("undefined" maps to null)
- aria-expanded ("undefined" maps to null)
- aria-hidden ("undefined" maps to False state)
- aria-orientation ("undefined" maps to null)
- aria-pressed ("undefined" maps to null)
- aria-selected ("undefined" maps to null)
Note: Each of these 6 attributes also supports the empty string as a keyword, so ""
and "undefined" are the same.
Only two enumerated ARIA attributes have differing invalid/missing value defaults and they don't support "undefined" however, any invalid value provided to them should result in a value of "true" per spec (now that they're enumerated, this is handled by the invalid value default):
- aria-current
- invalid value default = True state
- missing value default = False state
- aria-invalid
- invalid value default = True state
- missing value default = False state
https://bugs.webkit.org/show_bug.cgi?id=296851 rdar://157952768 Reviewed by NOBODY (OOPS!). Adds 'status: developer' feature flag for enumerated ARIA attributes: w3c/aria#2484. The ARIA spec intends to convert the following attributes to be enumerated, i.e., content attributes with permissible keywords and invalid/missing value defaults: - aria-atomic - aria-autocomplete - aria-busy - aria-checked - aria-current - aria-disabled - aria-expanded - aria-haspopup - aria-hidden - aria-invalid - aria-live - aria-modal - aria-multiline - aria-multiselectable - aria-orientation - aria-pressed - aria-readonly - aria-required - aria-selected - aria-sort This PR changes ARIA's IDL to use [ReflectSetter] for enumerated attributes in order to implement the desired reflection behavior behind a flag using manual getters; this also allows maintaining current ARIA IDL behavior when the flag is disabled. When ARIA PR WebKit#2484 lands, ARIA's IDL should be updated to use [Reflect, Enumerated] for automatic JS bindings codegen that doesn't need manual code. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/accessibility/AriaAttributes.idl: * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::ariaAtomic const): (WebCore::Element::ariaAutoComplete const): (WebCore::Element::ariaBusy const): (WebCore::Element::ariaChecked const): (WebCore::Element::ariaCurrent const): (WebCore::Element::ariaDisabled const): (WebCore::Element::ariaExpanded const): (WebCore::Element::ariaHasPopup const): (WebCore::Element::ariaHidden const): (WebCore::Element::ariaInvalid const): (WebCore::Element::ariaLive const): (WebCore::Element::ariaModal const): (WebCore::Element::ariaMultiLine const): (WebCore::Element::ariaMultiSelectable const): (WebCore::Element::ariaOrientation const): (WebCore::Element::ariaPressed const): (WebCore::Element::ariaReadOnly const): (WebCore::Element::ariaRequired const): (WebCore::Element::ariaSelected const): (WebCore::Element::ariaSort const): * Tools/DumpRenderTree/TestOptions.cpp * Tools/WebKitTestRunner/TestOptions.cpp
https://bugs.webkit.org/show_bug.cgi?id=296851 rdar://157952768 Reviewed by NOBODY (OOPS!). Adds 'status: developer' feature flag for enumerated ARIA attributes: w3c/aria#2484. The ARIA spec intends to convert the following attributes to be enumerated, i.e., content attributes with permissible keywords and invalid/missing value defaults: - aria-atomic - aria-autocomplete - aria-busy - aria-checked - aria-current - aria-disabled - aria-expanded - aria-haspopup - aria-hidden - aria-invalid - aria-live - aria-modal - aria-multiline - aria-multiselectable - aria-orientation - aria-pressed - aria-readonly - aria-required - aria-selected - aria-sort This PR changes ARIA's IDL to use [ReflectSetter] for enumerated attributes in order to implement the desired reflection behavior behind a flag using manual getters; this also allows maintaining current ARIA IDL behavior when the flag is disabled. When ARIA PR WebKit#2484 lands, ARIA's IDL should be updated to use [Reflect, Enumerated] for automatic JS bindings codegen that doesn't need manual code. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/accessibility/AriaAttributes.idl: * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::ariaAtomic const): (WebCore::Element::ariaAutoComplete const): (WebCore::Element::ariaBusy const): (WebCore::Element::ariaChecked const): (WebCore::Element::ariaCurrent const): (WebCore::Element::ariaDisabled const): (WebCore::Element::ariaExpanded const): (WebCore::Element::ariaHasPopup const): (WebCore::Element::ariaHidden const): (WebCore::Element::ariaInvalid const): (WebCore::Element::ariaLive const): (WebCore::Element::ariaModal const): (WebCore::Element::ariaMultiLine const): (WebCore::Element::ariaMultiSelectable const): (WebCore::Element::ariaOrientation const): (WebCore::Element::ariaPressed const): (WebCore::Element::ariaReadOnly const): (WebCore::Element::ariaRequired const): (WebCore::Element::ariaSelected const): (WebCore::Element::ariaSort const): * Tools/DumpRenderTree/TestOptions.cpp: * Tools/WebKitTestRunner/TestOptions.cpp:
https://bugs.webkit.org/show_bug.cgi?id=296851 rdar://157952768 Reviewed by NOBODY (OOPS!). Adds 'status: developer' feature flag for enumerated ARIA attributes: w3c/aria#2484. The ARIA spec intends to convert the following attributes to be enumerated, i.e., content attributes with permissible keywords and invalid/missing value defaults: - aria-atomic - aria-autocomplete - aria-busy - aria-checked - aria-current - aria-disabled - aria-expanded - aria-haspopup - aria-hidden - aria-invalid - aria-live - aria-modal - aria-multiline - aria-multiselectable - aria-orientation - aria-pressed - aria-readonly - aria-required - aria-selected - aria-sort This PR changes ARIA's IDL to use [ReflectSetter] for enumerated attributes in order to implement the desired reflection behavior behind a flag using manual getters; this also allows maintaining current ARIA IDL behavior when the flag is disabled. When ARIA PR WebKit#2484 lands, ARIA's IDL should be updated to use [Reflect, Enumerated] for automatic JS bindings codegen that doesn't need manual code. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/accessibility/AriaAttributes.idl: * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::ariaAtomic const): (WebCore::Element::ariaAutoComplete const): (WebCore::Element::ariaBusy const): (WebCore::Element::ariaChecked const): (WebCore::Element::ariaCurrent const): (WebCore::Element::ariaDisabled const): (WebCore::Element::ariaExpanded const): (WebCore::Element::ariaHasPopup const): (WebCore::Element::ariaHidden const): (WebCore::Element::ariaInvalid const): (WebCore::Element::ariaLive const): (WebCore::Element::ariaModal const): (WebCore::Element::ariaMultiLine const): (WebCore::Element::ariaMultiSelectable const): (WebCore::Element::ariaOrientation const): (WebCore::Element::ariaPressed const): (WebCore::Element::ariaReadOnly const): (WebCore::Element::ariaRequired const): (WebCore::Element::ariaSelected const): (WebCore::Element::ariaSort const): * Tools/DumpRenderTree/TestOptions.cpp: * Tools/WebKitTestRunner/TestOptions.cpp:
https://bugs.webkit.org/show_bug.cgi?id=296851 rdar://157952768 Reviewed by Tyler Wilcock and Ryosuke Niwa. Adds 'status: developer' feature flag for enumerated ARIA attributes: w3c/aria#2484. The ARIA spec intends to convert the following attributes to be enumerated, i.e., content attributes with permissible keywords and invalid/missing value defaults: - aria-atomic - aria-autocomplete - aria-busy - aria-checked - aria-current - aria-disabled - aria-expanded - aria-haspopup - aria-hidden - aria-invalid - aria-live - aria-modal - aria-multiline - aria-multiselectable - aria-orientation - aria-pressed - aria-readonly - aria-required - aria-selected - aria-sort This PR changes ARIA's IDL to use [ReflectSetter] for enumerated attributes in order to implement the desired reflection behavior behind a flag using manual getters; this also allows maintaining current ARIA IDL behavior when the flag is disabled. When ARIA PR WebKit#2484 lands, ARIA's IDL should be updated to use [Reflect, Enumerated] for automatic JS bindings codegen that doesn't need manual code. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/accessibility/AriaAttributes.idl: * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::ariaAtomic const): (WebCore::Element::ariaAutoComplete const): (WebCore::Element::ariaBusy const): (WebCore::Element::ariaChecked const): (WebCore::Element::ariaCurrent const): (WebCore::Element::ariaDisabled const): (WebCore::Element::ariaExpanded const): (WebCore::Element::ariaHasPopup const): (WebCore::Element::ariaHidden const): (WebCore::Element::ariaInvalid const): (WebCore::Element::ariaLive const): (WebCore::Element::ariaModal const): (WebCore::Element::ariaMultiLine const): (WebCore::Element::ariaMultiSelectable const): (WebCore::Element::ariaOrientation const): (WebCore::Element::ariaPressed const): (WebCore::Element::ariaReadOnly const): (WebCore::Element::ariaRequired const): (WebCore::Element::ariaSelected const): (WebCore::Element::ariaSort const): * Tools/DumpRenderTree/TestOptions.cpp: * Tools/WebKitTestRunner/TestOptions.cpp: Canonical link: https://commits.webkit.org/299159@main
https://bugs.webkit.org/show_bug.cgi?id=296851 rdar://157952768 Reviewed by Tyler Wilcock and Ryosuke Niwa. Adds 'status: developer' feature flag for enumerated ARIA attributes: w3c/aria#2484. The ARIA spec intends to convert the following attributes to be enumerated, i.e., content attributes with permissible keywords and invalid/missing value defaults: - aria-atomic - aria-autocomplete - aria-busy - aria-checked - aria-current - aria-disabled - aria-expanded - aria-haspopup - aria-hidden - aria-invalid - aria-live - aria-modal - aria-multiline - aria-multiselectable - aria-orientation - aria-pressed - aria-readonly - aria-required - aria-selected - aria-sort This PR changes ARIA's IDL to use [ReflectSetter] for enumerated attributes in order to implement the desired reflection behavior behind a flag using manual getters; this also allows maintaining current ARIA IDL behavior when the flag is disabled. When ARIA PR WebKit#2484 lands, ARIA's IDL should be updated to use [Reflect, Enumerated] for automatic JS bindings codegen that doesn't need manual code. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/accessibility/AriaAttributes.idl: * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::ariaAtomic const): (WebCore::Element::ariaAutoComplete const): (WebCore::Element::ariaBusy const): (WebCore::Element::ariaChecked const): (WebCore::Element::ariaCurrent const): (WebCore::Element::ariaDisabled const): (WebCore::Element::ariaExpanded const): (WebCore::Element::ariaHasPopup const): (WebCore::Element::ariaHidden const): (WebCore::Element::ariaInvalid const): (WebCore::Element::ariaLive const): (WebCore::Element::ariaModal const): (WebCore::Element::ariaMultiLine const): (WebCore::Element::ariaMultiSelectable const): (WebCore::Element::ariaOrientation const): (WebCore::Element::ariaPressed const): (WebCore::Element::ariaReadOnly const): (WebCore::Element::ariaRequired const): (WebCore::Element::ariaSelected const): (WebCore::Element::ariaSort const): * Tools/DumpRenderTree/TestOptions.cpp: * Tools/WebKitTestRunner/TestOptions.cpp: Canonical link: https://commits.webkit.org/299159@main
b2ba05c
to
38a1bfc
Compare
I've made many updates to this PR addressing outstanding feedback. I've also updated the PR description with a link to an unofficial explainer, details on how to test (via Safari feature flag) and more. I've also reached out to the Salesforce folks (thanks @gregwhitworth!) to follow up on any impact related to their LWC ARIA polyfill. I will Agenda+ to discuss these outstanding questions:
|
@keithamus @cookiecrook @rahimabdi met with the Salesforce team (@gregwhitworth and others) on Sept 30 2025 to discuss impact/risks for Salesforce frameworks, and to request testing. I've captured meeting notes/next steps in the "Meeting Notes" section in the PR description. |
Closes #2281
Closes #2279
Mini-Explainer
See ARIA IDL updates mini-explainer.
Summary of Changes
Feature Flag Testing in Safari Tech Preview
You can test the new ARIA IDL reflection behavior with a feature flag in Safari Tech Preview 228. Ensure that "Show features for developers" is enabled (Settings -> Advanced), and then enable the "Enumerated ARIA Attribute Reflection" flag (Settings -> Feature Flags, "JavaScript" section).
The following page can help with quick IDL testing: https://2553411.playcode.io.
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.
Meeting Notes
ARIA WG & Salesforce Sync (Sept 30 2025)
For first-party code, Salesforce framework doesn’t do significant normalization; primary areas of concern would be new behavior around null/undefined/default values
Preview | Diff