-
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
aria-describedby, verbose vs. concise and arbitrary 'state' information #1649
Comments
It depends. aria-describedby and aria-description are also for describing custom states (for instance a "read" state of a message in a feed). Never use aria-label or aria-labelledby for that since a label is NOT a state. If ARIA spec is not clear here it should be enhanced. BTW, for a number in a shopping basket icon button with badge this is not so clear. You can code this with
with yields speech output as "Shopping basket button contains 2 items" The info may be better read in a continous way as label which makes sense in this case. Here I can imagine an
and speech output "Shopping basket with 2 items button" as more natural textual representation of the content. |
Thank you! That's how I understood it too. Yes, I think the spec should be clearer on this point, and state should be explicitly contraindicated under the spec for The words "verbose" and "concise" are therefore misleading, since the kind of UI state we are talking about is typically very concise indeed. |
I think the badge can be part of the Accessible Name or the Accessible Description, depending on the context. For example, if an icon for unread messages is only displayed when there are such messages, then it would make sense to use the icon with the number as part of the Accessible Name ("3 unread messages"). If the icon for the messages is always displayed and the badge only when there are new messages, then the following would make sense:
I agree with you, though, that a description doesn't always have to be verbose. It can be shorter than the label, e.g. even if it contains operating and input instructions. More important would be the distinction:
|
I strongly disagree to the general statement that accessible descriptions should NOT contain additional information necessary for understanding and operation. A lot of custom properties out in the world ARE important for operation and is is not a good approach to put these in Label "just because people cannot switch that off". |
Accessible description could be either, where |
Makes some sense for me. Precedence rules for semantic importance are also within the APG realm, I think. They have a separate GitHub for that: |
I wouldn't say that: if I have a light bulb that allows me to turn on, turn off, and dim lights, then its label might be:
|
Interactively, this could be also the VALUE of a slider-like thing or a classy RadioButton Group selector with the actual value being set on user choice. So your example is exposing a display-only version of that value. Of course, this output may be plain text which maps better to label-like things. My examples are for interactive things. As said, it really depends on the use case. |
jaws-test says: @stes-acc Power users can disable the description output in the settings because they already know how to operate elements or what values are expected for elements. Therefore I would say that all absolutely necessary information of the element should not be conveyed in the description (but by name, role, value and status) - and the description should contain secondary information. @JAWS-test |
Just want to connect to #711 |
One conceptual problem I see with "hacking" state into the accessible name is that it takes us away from the principle that the name uniquely identifies the element. Is this not a problem? |
It is, annother reason. In #711 it is also stated in the first comment: "In my opinion, aria-labelledby should only be used for labels and never be used for the value. Label and value are different things." So states do normally also represent values ( their own ones :-) ) and I see that in this sense. |
I think most of the time it's best to use the appropriate HTML elements/attributes or ARIA attributes for name, role, value, and description that will ensure that the information can be correctly submitted to the Accessibility API. However, if the issue is that I can't submit a custom status as a status because that status doesn't exist programmatically, then the status can be submitted in the name or description depending on the context (or even in the role via aria-roledescription if necessary). In some cases it may make more sense to use the name instead of the description, among other things because the description is not output when reading the content with the screen reader's virtual cursor. |
I worry that this is veering into over-complicating things, particularly by thinking Again per the OP:
why can't this just have an accessible name of "unread posts, X"? Visually i imagine this might be rendered as an icon with the number being the only visible text? Would consider this beneficial to include that text in the name then.
Similar to the above. accessible name "checkout cart, X items". Neither this nor the above's "badges" represent a value or state for the current control – they are referential to the state of other content.
I actually don't have a clear understanding of what the UI would be for this, and can think of a variety of scenarios where different markup patterns (with or without aria) might be appropriate. |
It seems to me that we agree that the phrase.
is not quite correct, since a description need not to be verbose. The question would be whether we can rephrase the sentence so that a description includes secondary information that may or may not be verbose |
Oh! Could you explain why not? The spec for "state" says
(emphasis mine)
Of course not, but the whole point of this thread is to discuss arbitrary (or custom) states which might be added to a standard element without affecting the essential nature (i.e. the role) of the object. |
To be crystal clear, aria-valuetext has NO place here :) I don't know why this impression came up. I also don't think we are overcomplicating things. We just need to have a clear advice which ARIA attribute is OK to put custom object properties in. Simple question. If the answer to this is "none" this is not acceptable. If the answer is "it depends", well then we need more use cases that makes the need for this more clear. |
The reason |
closes #1649 These editorial changes attempt to clarify that a description _doesn't have to be verbose_. It also adjusts some wording so when talking about an accessible name, the spec is saying that, and not using the term "label" This update touches `aria-labelledby` and `aria-describedby` - because they share the same paragraph between the two. It also touches `aria-description` which also was semi-reusing the paragraph that was repeated between `aria-labelledby` and `aria-describedby` - but it also needed a few wording changes. Happy for others to add onto this or make further wording adjustments as need be.
For these use cases these aren't custom object properties. They're not descriptive of the buttons or links themselves, but rather what someone can expect to find in their associated content (e.g., disclosure widget panel, or on the page loaded after following the link). Circling back to the OP. I've made a PR to adjust some of the wording to indicate that a description doesn't have to be verbose. I have not added anything to clarify how to communicate "state" here... I think these would be better topics for authoring guidance, and worry that adding in such nuance here goes beyond the scope of what the spec needs to clarify. We can, of course, discus that in one of the next WG calls when reviewing the issue/PR. |
These editorial changes attempt to clarify that a description _doesn't have to be verbose_. It also adjusts some wording so when talking about an accessible name, the spec is saying that, and not using the term "label". This update touches `aria-labelledby` and `aria-describedby` - because they share the same paragraph between the two. It also touches `aria-description` which also was semi-reusing the paragraph that was repeated between `aria-labelledby` and `aria-describedby` - but it also needed a few wording changes. Closes #1649
There is a semantic aspect of
aria-describedby
which I think may get lost with the current spec copy, or perhaps I misunderstand something. Here are a couple of rather common use cases by way of illustration:These cases seem semantically identical.
I assume that the most correct way to associate the item count 'badge' or the process state icon with the element is to point to the id of the badge/icon with
aria-describedby
- is that right?If so, I am concerned that the spec for
aria-describedby
states(Emphasis mine). What bothers me here is that the item count in both the cases mentioned above is just a single value, and is certainly concise, rather than verbose. Strictly speaking, it's state, pure and simple. The current wording might lead authors to look beyond these attributes for expressing state values, or to 'hack' the accessible name to include this additional (and semantically distinct) text.
I strongly believe that concatenating an accessible name with semantically distinct strings that express state is an anti-pattern which indicates that a role or relationship may be missing. Similarly, it's preferred to rely on
aria-pressed
to express the state of a toggle button, rather than manipulating the accessible name.I suppose that what is intended by the words "concise" and "verbose" is that
aria-describedby
calls for 'flat' strings (i.e. without further semantic variation).The point appears to be to distinguish this attribute from
aria-details
which can point to rich text ("verbose"). Yetaria-details
is not mentioned as a possible alternative in the spec foraria-describedby
, in the useful way that certain other parts of the spec guide authors to make the other appropriate choices where there may be similarities in the semantics.The distinction is made in the ARIA annotations spec. I approve of this clarity, and hope the distinction will be included in the 1.3 spec for
aria-describedby
.So there are two problems here, one is to guide readers of the ARIA spec to make the correct choice between
aria-labelledby
,aria-describedby
andaria-details
based not on the razor of verbose/concise but on whether the indicated element isaria-labelledby
)aria-describedby
)aria-details
)... and secondly, to make it fully legitimate that concise 'state' annotations (such as the item counts or process state in the examples above) are valid use cases for
aria-describedby
- and I don't think that APG examples will be quite enough to make this unambiguous.Or maybe I've got this all wrong, and someone could clear up my doubt about this. Is
aria-describedby
the wrong thing for arbitrary 'state' information associated with an element? Do we need something else?The text was updated successfully, but these errors were encountered: