-
Notifications
You must be signed in to change notification settings - Fork 132
alt vs title: HTML-AAM and accname specs have conflicting requirements #2491
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
Comments
That is not completely true, since empty |
OK — so maybe I can instead interpret “unless the element is marked as presentational (role="presentation" or role="none")” to mean “unless the element has a
But that “unless the element is marked as presentational” condition is in a step for computing the name, right? So it seems like I can’t determine if I have an “empty So if what the editors really intended here is “unless the element has a |
@sideshowbarker HTML AAMs steps are meant to take priority here. I can sort of see why this is reading weird, though... i think the "unless the current node is exposed as presentational (role="presentation" or role="none")." likely needs to be clarified. (also not sure why your quoted text is different than the latest draft i pulled this from - e.g., your text says 'marked' but the accname spec says 'exposed') For instance, that text is likely meant to cover these cases:
where because these are marked as Building on the point that presentational items aren't meant to be named - by this point the aria-label/aria-labelledby step which would have triggered the conflict resolution for presentational items, has already occurred. So, I think it's a misinterpretation to read this and think that per this step, if an element has
Maybe clarification for something like this might also help with w3c/accname#250 - where a more overt statement to check/refer to host language's steps for more specifics vs the generalized accname spec is in order? |
Thanks, I see. However, it’s quite possible I’m just really confused, but it’s not clear to me how that’s actually relevant to what I’ve brought up. What I mean is: The concrete cases I’m concerned with at these two:
Aren’t both of those the same markup case? That is, they’re both an But the expected result for the first case seems to be that it has no name — while the expected result for the second case seems to be that it instead has a name (and therefore is So concretely: I’m just trying to get my implementation to pass both of those tests. But if I attempt to make it pass the first test, then I fail the second test. And if I instead attempt to make it pass the second test, then I fail the second test. So is there something I’m missing here? Or are those two test written to conform to different/conflicting spec requirements?
I’m not interpreting the spec. I’m attempting to strictly implement what it actually says. So based on what I have implemented, it’s not clear to me if/when any implementation that actually follows the spec is actually going to have determined what the element’s role is. But then, see w3c/html-aam#570 — which is about the fact that, as far as I can see, the HTML-AAM spec as currently written seems to require that in order to compute a role for an |
The second of these tests has been recently added by me, without noticing the first 🙈 (nor remembering the fact that "no alt" trumps "title" in terms of image naming…) So I guess it is the one we need to update. |
Ah, OK — that clears up that part at least. I’ve gone ahead and opened web-platform-tests/wpt#51593. As I mention there, if you can accept the invite to join the web-platform-tests and the reviewers team, I can set you as the reviewer for that PR. And that’ll also enable requesting review from you on future PRs. |
Yeah, seeing those two tests helps clear this up a lot… That second test should be removed (or changed to indicate the expected role is generic, as the PR to adjust had done/has been merged) since it’s essentially a dupe of the first but expecting a result that doesn’t match the spec… |
@sideshowbarker I've submitted an accname PR to clarify treatment of |
Given an
img
with an emptyalt
attribute and a non-emptytitle
attribute, the HTML-AAM spec requires using the emptyalt
value as the accessible name. But the accname spec requires ignoring that emptyalt
and instead using the non-emptytitle
value.Details
At https://w3c.github.io/html-aam/#img-element-accessible-name-computation the HTML-AAM spec says this:
Note in particular, the even if its value is the empty string language.
But at https://w3c.github.io/accname/#comp_host_language_label, the accname spec says this:
Because an
alt
attribute with the value of the empty string (alt=""
) marks the element as presentational, then a reasonable reading of that accname requirement cited above is:When the
alt
value is the empty string, the algorithm reaches the unless the element is marked as presentational part — in which case the requirement is to not return the alternative, but instead fall through (skip) the E. Host Language Label step, and so then move on to using thetitle
value.In other words, the accname spec says to ignore the empty
alt
, but the HTML-AAM instead requires using it.Link to the version of the specification or documentation you were looking at at.
Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?
Yes
The text was updated successfully, but these errors were encountered: