-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Loosen DOMString? getter to accommodate ARIA-style string reflection #10974
Loosen DOMString? getter to accommodate ARIA-style string reflection #10974
Conversation
Can you clarify which of the paths outlined in #10037 this follows? |
@domenic Apologies, please see this latest comment in the issue: #10037 (comment). |
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.
Thanks! Couple more nits.
…extraneous null assignment removal step
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 thanks again for tackling this!
This looks good to me now. With this PR in place ARIA can use DOMString?
and use the reflect language for IDL attributes whose content attributes are not defined as enumerated attributes. The meaning of which will be that if the content attribute is absent, the IDL attribute getter will return null. (And the IDL attribute setter will remove the content attribute when given the null value. Though this does not require further changes on the HTML side.)
While this was not the most desirable solution, it is the most reasonable one now that everyone has shipped. And in parallel ARIA folks will continue to investigate migrating their content attributes to become proper enumerated attributes as that would yield additional benefits, such as feature testing.
@domenic any further thoughts from you?
This looks good, although since we have decided on 1A instead of 2A, I wonder if we should have some sort of normative guidance in https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#using-reflect-in-specifications to avoid using DOMString? for non-enumerated attributes. |
It would probably be good to have some more detailed advice on attribute design in general, but I would not really want to block this PR on that as this seems like a strict improvement over not having anything. It's also quite nuanced as I don't think we generally prefer |
Addresses #10037.
The ARIA WG is currently working on improving IDL which includes converting ARIA attributes (where applicable/possible) to be truly enumerated.
As a subtask of this general work, this PR loosens HTML spec to allow
DOMString?
reflection that is not limited to only known values. This is desirable for non-enumerated ARIA content attributes (e.g.,aria-label
,role
) where the most appropriate IDL attribute type isDOMString?
and the absence of the attribute's value is meaningful. This change will also ensure HTML-conformant reflection for future ARIA attributes that require string reflection.CC @annevk
(See WHATWG Working Mode: Changes for more details.)
/acknowledgements.html ( diff )
/common-dom-interfaces.html ( diff )