-
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
ARIA attribute reflection uses DOMString? but they are not enumerated attributes #10037
Comments
Should this include |
On pursuing number 4, I presume it would consist of the following: For ARIA's Depending on implementer appetite we could also make a change to ensure the reflections are limited to only known values. I suppose this would be a breaking change but I don't know what the impact would be. Am I correct in saying that we could/should alter freeform reflected properties such as |
This is mostly right. However, there's a dilemma which makes it more annoying: currently in HTML
No. The question is whether we should change them from |
Helps with #9832, by consistently using "(the empty string)" and placing such rows in the same place in the enumerated attribute tables.
Hi @domenic,
After discussion with @annevk @cookiecrook, and also with the ARIA WG (w3c/aria#2414 (comment)), there is agreement that this approach you mentioned of relaxing the Thank you! |
I'll ask again here, since I wasn't able to get an answer when asking in #10974 (comment): can you clarify which of the paths outlined in the OP you are proposing? Is it 1A, 1B, 2A, 2B, ...? |
I think that would be 1A for this issue:
The ARIA WG is also exploring proposal 4 as a concurrent, separate issue:
|
What is the issue with the HTML Standard?
ARIAMixin on Element says:
So, let's go look at what the getter algorithm for, say,
ariaLive
reflectingaria-live=""
would be.ariaLive
is defined as[CEReactions] attribute DOMString? ariaLive;
i.e. it's a
DOMString?
. But HTML'sDOMString?
getter reflection says:These asserts generally fail.
The spec might imply that the first succeeds: the definition for
aria-live=""
states that its "Value:" is "token", and the ARIA type mapping states that "token" "Value:" should somehow map to HTML's Keywords and enumerated attributes section. (With what invalid value default and missing value default? What keyword vs. state mapping, exactly?)For the second assert (and thus the third as well), there's no evidence that the attributes are limited to only known values. Testing in browsers, it's certainly not the case:
document.body.ariaLive = "foo"
will happily work, withdocument.body.ariaLive === "foo"
on the next line succeeding.And of course, picking
ariaLive
was already stacking the deck in our favor. If we didariaDescription
, which corresponds to the "string"-"Value:"d `aria-description="" attribute, then certainly it would not be an enumerated attribute.Note that this seems to be implemented in all browsers, according to WPTs.
I see a few paths forward here:
1A. Allow
DOMString?
reflection for all attributes. Try to avoid using it in the future for such unrestricted cases.1B Allow
DOMString?
reflection for attributes starting witharia-*
only, as a legacy exception.2A Decide that
DOMString?
is a nicer way of doing string reflection thanDOMString
(since it distinguishes between the attribute being missing and it being present as the empty string), and going forward use it for all new HTML attributes that reflect as strings.2B Decide that
DOMString?
is a nicer way of doing string reflection thanDOMString
, and try to not only use it going forward, but to also change the behavior of existing HTML attributes.3 Try to change away from
DOMString?
to instead justDOMString
. The behavior change here is that absent attributes would return the empty string, and setting the value tonull
would no longer remove the attribute but would instead set the attribute's value to the string"null"
.4 On a case-by-case basis, update the ARIA IDL attributes to have the best possible reflection semantics, including possibly "limited to only known values" enumerated attribute behavior.
There are some previous issues tracking this on the ARIA side, most notably w3c/aria#1110, but I wanted to summarize the current state of things. Especially since the easiest path, like 1A or 1B, would involve changes solely to HTML.
/cc @annevk @cookiecrook @alice
The text was updated successfully, but these errors were encountered: