-
Notifications
You must be signed in to change notification settings - Fork 125
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
Clarify how "otherwise interactive" relates to overriding the none/presentation role #1628
Comments
I think I might disagree. Here's a case where I think it's reasonable. The click handler might be on an ancestor just for authoring reasons.
|
Another case might be where the author has the same functionality available on a nearby widget, and doesn't want to expose it in the tree twice (e.g. there's a separate thumbnail and caption that you can click on). |
The thing that make that example valid is that the element contains some descendants with known "interactive" roles like button. Maybe we can account for this delegation-to-descendant case by limiting it to where there are no focusable or interactive contents? Only text nodes or other "static" contents? |
Yeah, that's a good example. |
That seems like a potentially expensive computation. |
So maybe we just do this on leaf nodes and ignore any delegation of the delegation contexts? Your duplicate widget example could still get exposed, but |
I think "or otherwise interactive" should be removed from the specification because it is not possible for the browsers to recognise whether the event handlers are relevant to the role and operation of the respective element. On many pages, the screen reader then outputs "clickable" or "mouseover" for each text element because corresponding event handlers are used on the body. Each element needs a correct role and errors in the web page design cannot always be corrected sensibly by the browsers. |
I think using role="none" is on an element with an onclick is a valuable technique. If the author is using ARIA, we should lean toward trusting them on this one. It allows them to have element(s) elsewhere that are in the AX tree and handle the interaction. There could be many reasons why the role="none" element is the wrong one to present as interactive to the user. |
Summarizing again from this morning's call (minutes), though discussion ended early again. I've been convinced by @aleventhal that we should not override the role on any container element where the event handler may be used for event delegation to descendant leaf nodes. Author usage is too ambiguous to override the role. I think @aleventhal has been convinced that So we're back to leaf nodes only... such as the following contrived examples: <img role="none" onclick="alert('Hello world');">
<div role="none" onclick="alert('Hello world');">Test</div>
<h1 role="none" onclick="alert('Hello world');">Test</h1> Someone (I think @jnurthen but maybe @mcking65) mentioned that it should not fall back to the native role, but fall back to the @jnurthen also mentioned that this related to @jcsteh's point in Issue ?? that title on image is a form of interactivity. So these examples may also be worth considering as "otherwise interactive." <!-- does the browser's tooltip overlay make these images "otherwise interactive"? -->
<img title="hello world" alt=""><!-- implicit role=none? b/c of alt="" -->
<img role="none" title="hello world" alt=""> |
@JAWS-test wrote:
I don't agree that's the case in all instances, but I'm open to being convinced otherwise.
This was already addressed in the initial issue description (third bullet). Events on the body are referred to as "event delegation" which we would explicitly ignore. Aaron further convinced me that event delegation on any ancestor is also too ambiguous to include, which was another question from the original description (fourth bullet). |
Someone remind me the practical downside of saying event handlers aren't
enough to override role="none", in terms of exposing a node.
Just trust the author in those cases.
Being something that's navigable with the keyboard though, that should be
enough to override.
|
@aleventhal wrote:
I don't see a practical downside to overriding role=none in examples like this: <div role="none" onclick="alert('Hello world');">Test</div> The downside to not overriding is that there's an interactive element that is not exposed to AT. Many authors still get this wrong, so if it's a 1) rendered leaf node, 2) has a click handler, and 3) isn't explicitly hidden with
I'm not sure I understand. This makes it seem you mean the opposite of how I read your first sentence. Are you suggesting this issue be closed by removing the text "or otherwise interactive?" If so, I don't agree. ARIA has always been fairly keyboard centric, but I don't think that's a reasonable way to infer "interactivity" anymore. |
Are we sure many authors are doing this specific thing -- an event handler with role="none", where usability would be hampered by obeying the role="none"? If I'm an author it seems intuitive that I can use role="none" to avoid having an extra announcement. I would not expect authors to go read and find out that in this one case role="none" won't work.
I think any rule here that hinges on leafiness loses some spec simplicity for little gain. To me, I don't think we can prove user benefit of having a rule like that. It feels like we're adding complexity. My thought is that we make things simpler for the authors and UA developers. However, I don't really feel that strongly about it as this is all an edge case. What do others think? Yes, I think it is worth looking into whether the "or otherwise interactive" clause nets any real user benefit. |
@aleventhal I'm interpreting your concern as:
Is that a fair summary of your concern Aaron? If so, the @JAWS-test suggestion to remove "or otherwise interactive" would solve your concern. I'm worried about future modalities where "focusable" may not apply, but I could be convinced to ignore those concerns for now and address them later when they arise. I'll consult with others inside Apple. I'd also like to hear opinions from @joanmarie and @jcsteh if possible. |
James that's fair. And I think also:
4. There are real cases where it would be fair to do this, and in fact
authors might be doing it already
|
I'm ok with removing "otherwise interactive." I think I remember where this came from. We were concerned that the same would happen with role=presentation. I didn't, and won't, because missing role doesn't cause validation errors. |
From a WebKit discussion with @twilco, the following markup results in the element being presentational, even though it has a click handler. The behavior is identical in Safari, Firefox, and Chrome.
However, the ARIA spec in §9.3 states (emphasis mine):
It seems reasonable that the implementations are wrong here, and the click handler would make this count as "otherwise interactive."
Discussion points for the working group:
The text was updated successfully, but these errors were encountered: