-
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
Tentative: update point E. Host Language Label of the Acc Name algorithm #2405
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 site configuration. |
@giacomo-petri to create a wpt test |
i think the examples you have in your issue / wpt are confusing me. because with this change you're making it clear that unless the current node (so the input in your examples) is marked as presentational, then the element should be named from its attribute or element. but your wpt puts the role=presentation on the label. I agree with the expected name/label outcomes of those examples, but per this change i would have expected the input to be the thing that was tested with role=presentation on it.... and also in that case because it's focusable, i'd expect the conflict resolution to kick in and the presentation role to be ignored. it seems to me that the original text is more about something like: the inclusion of input/label here is at odds with how this text is probably expected to work for svgs / imgs. sorry if i've completely missed the point on this. i agree there's something weird here, but i'm confused if it's being solved or not with this pr / wpt |
Hmm... I didn't get your point either initially... When I raised the issue, I was specifically referring to examples such as:
Specs says:
In this particular case, it would be
But now I see what you mean.
Honestly, I thought the opposite, that presentation takes precedence over alt. 😄 Edit: "my scenario would not fit with this part of the algorithm" replaced with "a scenario with input with role presentation would not fit with this part of the algorithm" |
yeah, i agree that the switching between current node and element is awkward, since the first use of element indicates it's separate from the current node whose name is being calculated, but then the second instance of element 'could' be interpreted as the separate element or the current node...
but assuming element = element and not current node, reading from the current text in a bit more of plain language: so this is why i was saying i agree with the expected labels you have in your wpt PR - because marking a but with the change you made in this PR - the text would now read:
so to simply put it this time: if the input (current node) has a label (element) that defines its text alternative, return that alternative unless the input (current node) is exposed as presentational. per that text, i would have expected the wpt to also contain the following, because while i think it's important to rectify the example you're calling out - the spec text is now talking specifically about this markup:
which... doesn't really work out well, imo, for inputs - since it states something that also introduces the conflict resolution (unless the input was also made disabled / not focusable). this revised text makes more sense (to me) if this was just about img / svg elements - but that's maybe where we disagree a bit (which i also realize might be a bit off topic...), as i think it's contradictory to say hopefully this clarifies where i'm coming from futher |
imo, what would make more sense here per the original text, is if the naming items were hidden (not presentational) then they'd return no name. so
or, though i don't like the inconsistency, if ARIA was more explicit in saying that
|
When I read this, the way the sentence is structured led me to assume the opposite, similar to how WebKit and Chromium interpreted it. However, the phrasing is ambiguous, so it also supports the opposite interpretation, which is how Gecko handled it.
Here’s where it gets a bit nuanced: I’ve changed the term "marked" to "exposed." Even if the input is marked as presentational, it isn’t necessarily exposed as such due to presentational role conflict resolution. In your example:
the input doesn’t meet the "unless" condition because it's marked as presentational but is not exposed as such. It will still retain the accessible name provided by its label. (It might be helpful to link to the presentational role conflict resolution section for further clarification and specify somehow that it's by itself a violation - but there is a fallback to manage these scenarios consistently.) I think it’s reasonable to account for presentational role conflicts in the accessible name computation specs, so implementors can handle them consistently. As for the second comment: I'm also ok with it, but implementing it would require significant changes. |
i get what you're saying. but again that's why i'd say the wpt should have that example in it, to demonstrate the conflict resolution at play / have the example that matches the step (role=none on current node). and per your comment:
i think you agree? to be super duper clear - my biggest confusion with this came from the fact the wpt PR is checking what i would have assumed to check from the prior wording. the wpt PR misses what i'd expect it to be checking from the updated spec text. I think the wpt example is good and should be tested - i'm trying to say (as well as trying to determine if we were coming to the same conclusions) that it also needs this updated example as well. you could also put in the following in as another test, since it won't be focusable and browsers aren't all handing it the same:
chrome completely ignores the above, marking it as entirely ignored in the a11y tree. Finally, the wpt should probably also have other tests to account for other markup patterns that this applies to. such as:
yeah... i wasn't really expecting anything to change there - more just voicing what i see as an unfortunate inconsistency. |
Of course! I'd be happy to include this example with and without the disabled attribute. I'll have it added by the end of the day. |
I'm almost done with the disabled examples, but I'm a bit unclear on the expected output for some cases. For instance, what should be the output in terms of acc name of the following scenario?
The input is disabled and presentational, so it doesn't trigger the presentational role and is not exposed. Given this, what should the acc name be (in terms of data-expectedlabel)? Would it still be "test"? Would it be empty? Does it matter? This question also applies to the other examples you provided:
|
per the spec update you did, the first example
|
Test cases have been updated based on your recommendation and should align with what we discussed, except for the image. The image matches the PR but may not align with how you envision it should work. I'm happy to raise this with the group if we decide to make a change. Note: since this is also impacting presentational roles conflict resolution, I've also added some check about the role. Thanks! |
This took me a while to untangle. First, if the use of the word "element" is being used within the spec to indicate something specific like the starting point of the algorithm process, this is wrong and we need to change this to "root node" which is what that is meant to be. No matter how deep the current node traverses or is sent elsewhere using aria-describedby or aria-labelledby, the root node is always the top level starting point for that process. In this case that would be the input element. If an element like an image has role="presentation"/"none" on it, I would expect that element to be removed from the accessibility tree, and then no longer available to be included within the naming computation when the current node is traversing. With the exception of course, when that element is exposed because it also has an attribute that causes the presentational role to be ignored. E.G. Any valid attribute beginning with "aria-" such as aria-label and so on. This also seems to expose confusion about the order of precedence, such as if the AccName algorithm is parsed before or after the browser removes or updates the accessibility tree. Logically it can only be applied after the browser finishes changing the tree, which would mean that hidden or removed nodes would not be encountered by the current node traversal when computing the name. This is just my understanding though, so if others would like to chime in please do. We should probably talk about this during the meeting though, it seems more complicated than can be easily hashed out. |
@@ -610,7 +610,7 @@ <h4>Computation steps</h4> | |||
<li id="comp_host_language_label"> | |||
<span id="step2E"><!-- Don't link to this legacy numbered ID. --></span><em>Host Language Label:</em> Otherwise, if the <code>current node</code>'s native markup provides an | |||
[=attribute=] (e.g. <code>alt</code>) or [=element=] (e.g. HTML <code>label</code> or SVG <code>title</code>) that defines a text alternative, return that alternative in the form of | |||
a <code>flat string</code> as defined by the host language, unless the element is marked as presentational (<code>role="presentation"</code> or <code>role="none"</code>). | |||
a <code>flat string</code> as defined by the host language, unless the <code>current node</code> is exposed as presentational (<code>role="presentation"</code> or <code>role="none"</code>). |
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.
Thinking this through (mostly for myself TBH):
- "marked" is explicit author intent
- "exposed" is what browsers decide to do (and is irrespective of author's intent)
I want to make sure that we're all really clear about what changing this wording means.
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.
if this is a concern (and I got your point), what about "marked by the author and exposed by UA..."
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.
imo, simpler is better. intent vs not is probably a topic better clarified outside of an algorithm step. as then there can be nuances about whether that intent was even valid, hence why an author could mark something as presentational, but the browser is like "nope. not on that element you're not"
Closes: w3c/accname#108
This change clarifies the following:
Should this be marked as editorial?