-
Notifications
You must be signed in to change notification settings - Fork 126
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
Updating ARIA 1.2 due to IDL implementations (exit and re-enter CR?) #1598
Comments
Does the group need a test page need to be developed for IDL testing? |
Here's the PR #1611 |
Was an effort made to get implementations to change here? Are there tests? This change was made only a year ago too. Furthermore, it's not clear to me that the current text works as reflecting only supports nullable strings if the attribute is an enumerated attribute and meets the requirements thereof. See also the discussion in the issue @saschanaz referenced. |
Google WG members looked into changing the implementations, but it's a non-trivial amount of work with no clear user benefit. As such, we don't believe the engines need to change, so we'd like to take the WHATWG-recommended approach that you and others helped develop: update the spec to match what is already working in the implementations. |
But what exactly is that? The PR doesn't appear to do that as far as I can tell. It relies on reflect, but reflect doesn't handle this type for numerous ARIA attributes. |
Update: linked #1611 in the sidebar, which is the correct PR. …but the only substantive IDL change in this PR is to add the nullable The diff won't change any of the other still-commented |
It doesn't really, |
cc @domenic |
@annevk wrote:
When we first proposed adding IDL to ARIA, the standard version of IDL didn't include For the following HTML element: <div aria-label="foo"><!-- No role. This is just an example element for the output below. --></div> This is the console output in WebKit, and IIRC, it matches other engines. > $0.ariaLabel
< "foo"
> $0.getAttribute("aria-label")
< "foo"
> $0.setAttribute("aria-label", "")
< undefined
> $0.getAttribute("aria-label")
< ""
> $0.ariaLabel
< ""
> $0.removeAttribute("aria-label")
< undefined
> $0.ariaLabel
< null IIRC @joanmarie and @cyns were attempting to match the existing implementations, which treat these attributes like nullable, reflected DOMStrings, as demonstrated above. If there is a better syntax to express this in the current version of IDL, please advise. Thanks. |
I wonder what caused such amount of work, were there web compat issues? |
@cyns looked into this more for Chrome, but IIRC, the issue was that in every web engine, the backing accessibility implementation already handled validation, so duplicating that behavior in reflected enumerated DOM attributes was a reasonable amount of effort with no end-user impact. These sections were added to document how the implementations work today.
|
It sounds like Chrome couldn't do something like this: DOMString AriaMixin::AriaLabel() {
Nullable<DOMString> nullable = WhateverTheBackingAccessibilityImplDoes();
if (nullable.is_null()) {
return "";
}
return nullable.inner_value();
} ... which doesn't make sense to me, or I probably still lack the background here. |
"Reflect" has been a concept defined by the HTML standard for well over a decade so I think there might be some misunderstanding here. At least per my understanding this feature is a lot newer than that. |
Clarifying that I was referring to the ~ |
At the moment that's just an implementation detail. There's been some talk about standardizing it, but not a lot of progress. (It would still build upon "reflect" though so the issues would remain the same.) |
To be a bit clear, since nobody has stated it this way: right now your spec has a (conceptual) null pointer exception, since you apply the concept "reflect", but in spec-land that concept is totally inapplicable to |
After some additional digging and discussion with colleagues, I think there is a path forward. ARIA 1.2In order to get ARIA 1.2 through its long-overdue CR, remove the reference to HTML reflection and replace it with something like "Return the value of the attribute if present and null otherwise." This way the 1.2 spec still matches the shipping implementations. It can include in a Note the similarity/difference between this and HTML's concept of reflection. ARIA 1.3 or laterConsider changing the implementations to non-nullable reflected DOMStrings... (@cyns, @joanmarie, and @aleventhal to comment, since IIRC, it was one of them who mentioned an implementation, interop, or scheduling concern.) On the surface, it seems like this may be as simple as removing the |
In HTML crossOrigin on with the following: I'm not sure what is different for our usage of reflect than this. |
@jnurthen see #1598 (comment). |
@annevk What about |
|
@saschanaz I agree this would be hard to change for alt now. However, we don't want to introduce similar broken behaviour for aria attributes. |
Yeah and I don't think people are asking for the non-nullable behavior, it's just that the spec is broken and you need to define an actual algorithm for nullable non-enumerated string attributes. |
(And thanks, I think #1598 (comment) is the background I wanted as I wasn't sure nullable string is the way people actually want to go or just a webcompat quirk.) |
@saschanaz wrote:
Modifying my comment above to clarify a potential permanent solution rather than just a stop gap. I wrote:
Note: The enumerated attributes in ARIA may be 1:1 with the §6.7 list whose short description start with the word "Indicates…" (minus I think these are the new choices based on @saschanaz's comment:
|
I don't think solution 2 is adequate as that would only address getter behavior and that exact language doesn't establish a relationship between the name of the getter and the name of the attribute. |
@annevk wrote:
Is there a modification to ARIA Section §10.2 that would address your concern with the relationship between the ~reflected DOM property and respective content attributes? |
@annevk @saschanaz @domenic Will you be able to attend our meeting at TPAC so we can progress this? https://www.w3.org/events/meetings/e8be2735-d90b-4619-a25c-d25c0abdd965 |
I can probably attend, but it's unclear what a meeting will help with here. What is necessary is for someone to write a proposal with spec text and get it reviewed. |
I have a conflict for the first hour and it's rather late after that, but I can probably make that work. Agreed though that what's really needed here is for someone to write a proposal. |
TPAC ARIA Meeting has started. |
@annevk @domenic is this the type of text you are looking for? |
And @annevk FWIW we believe your relationship comment is already addressed. |
That's along the right lines. An issue is that "missing value default state" only applies to enumerated attributes, and nullable As @annevk pointed out in #1598 (comment) , the attributes we're dealing with here are not enumerated attributes. So that condition doesn't hold, and thus the spec text you propose doesn't really work as written. When do you want |
@domenic wrote:
I previously proposed "Return the value of the attribute if present and null otherwise" but I don't believe it's been answered why that simpler phrasing wouldn't work for these non-enumerated reflected strings. @annevk implied there's no relationship established between the name of the getter and the name of the attribute, but I believe that's already addressed by ARIA Section §10.2 If one or both of you could join the call (going on now) it may be easier to work out the disconnect. |
"Return the value of the attribute if present and null otherwise" would work. @annevk's response was that you failed to define the setter behavior, but if you combine that with the rest of #1598 (comment) it would be fine. Again, I don't think a call is necessary here. Proposing spec text and reviewing it, as we're doing asynchronously, works best for me. It would be even better if it was done in pull request form so we could use the normal code review tools. |
revising the proposed language: |
LGTM with a slight modification: "If a reflecting IDL attribute is a nullable DOMString attribute" should be "If a reflecting IDL attribute is a nullable DOMString attribute whose content attribute is not an enumerated attribute", so as to not conflict with the existing definition in https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes |
Thanks for clarifying. I think this was the bit we were blocked on. |
As described in #1585 (comment) as well as in ARIA WG meetings 1 and 2, what implementors have done for ARIA reflection does not appear to match what is in the spec.
In particular, default/implicit values for missing attributes are not being reflected, and no validation is taking place. When an attribute is not present in the DOM, the reflected value is null. Thus as it currently stands, I believe we have 0 implementations for the IDL interface as spec'ed in ARIA 1.2.
What is currently implemented seems consistent with the properties being a nullable
DOMString
. Therefore, unless there is a strong belief that what is in the spec now (attributes are a non-nullableDOMString
) is correct and that the implementations are wrong, the thing to do might be to update ARIA 1.2 to reflect (pun intended) reality.The text was updated successfully, but these errors were encountered: