-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Way of providing accessible name/description as an HTML element #7326
Comments
You may find some useful information in w3c/aria#1018 |
Thanks for opening this, @domenic. @carmacleod had raised an issue about this last year (specifically for landmarks). To sort of quickly go over some of your points:
FWIW, and this is specifically my own personal opinion, I am very much in favor of HTML adding an alternative mechanism beyond <!-- the following are not formal attribute name proposals -->
<section namefrom=id>
<h# id=id>My heading and name</h#>
...
</section>
<!-- or -->
<p namefor=foo>Groceries</p>
<ul id=foo>...</ul> If there is a new element to specifically allow for naming, that would also make sure that elements that don't always need names wouldn't be automatically named from their headings. I just don't have a good idea how that'd help out other HTML elements, per my list example, where the new HTML element wouldn't necessarily make sense as a child of the list. At least, not without updating the content model. I know that OpenUI has been kicking around the idea of I am very interested in other people's thoughts on this subject. |
Oh no, I'm so sorry I forgot about that issue; how embarrassing! That issue has a lot of good solutions brainstorming... um... let me close this one and we can move the discussion back over there, although I appreciate the time you gave to help answer my questions and I'll try to use that momentum in that thread. |
I think @domenic's and @scottaohara's discussion is a good primer set of questions / challenges and should be copied over to the old issue now that this has just been closed. |
coming in late, but just on this point
I'd note that, unless I'm missing something, that is mostly irrelevant because assistive tech will announce even actual rich HTML referenced via |
yes, true. i was reading that part more as a short coming of title itself being completely unable to allow for structured content. Whatever the new mechanism would still have a flattened string for the accName / description - but if as an actual HTML element, it would at least be available in the DOM for parsing itself. something to think about / a potentially greater issue than just creating a way for HTML to name / describe elements that doesn't rely on ARIA (or title). |
Given that they read normal rich text appropriately, I'd prefer to treat that as just a (significant!) failing of the current assistive tech, rather than something we assume as standard design. It's, uh, extremely bad. |
sure. but also consider - taking the |
Spinning off from some discussion early in #5811, and also relevant to some of the comments on sectioning content vs. not in #7320. /cc @whatwg/a11y
My understanding of the problem: several "section-ish" HTML elements, like section, article, aside, nav, dialog, and #7320's search, get their accessible name or description via this algorithm, which requires either using
aria-describedby=""
/aria-label=""
/aria-labelledby=""
attributes, or the HTMLtitle=""
attribute.In general, we want to encourage people to write accessible HTML without needing to rely on ARIA, and would like to co-evolve HTML in a way to improve the situation.
title=""
as the current non-ARIA way of providing such accessible names or descriptions is not great, for a couple of reasons:In many browsers, it will cause a tooltip to pop up on mouse hover. It's possible (perhaps likely) that a web developer might want a specific tooltip, but would not want to use the contents of the tooltip as an accessible name/description. Conversely, it's possible (perhaps likely) that a web developer might want a given accessible name/description, but not to cause a tooltip with that value.
It only accepts strings, not HTML. This means it loses important capabilities like supscripts/superscripts, ruby, language and directionality markup, etc. /cc @whatwg/i18n who have brought up this sort of thing a good deal in the past.
This issue is about whether we should consider adding new HTML element(s), or repurposing existing HTML element(s), to help with such accessible name/description computation.
Foundational questions I have about this project:
<hN>
elements? My vague understanding is that the hNs only contribute to heading-based navigation in most accessibility tech; I can't find any evidence in HTML-AAM or elsewhere that they interact with accessible name/description computation. Is that separation good, or bad? Naively I'd imagine that if you do<section><h3>Section title</h3>...</section>
, "Section title" would make a pretty good accessible name...Some more-detailed questions that might guide a possible proposal; probably not worth answering until we get the above straightened out:
title=""
first tries to use it as accessible name, then falls back to using it as the accessible description if anaria-label=""
/aria-labelledby=""
attribute "claimed" the accessible name value. Is that the kind of semantic we might want here, i.e. this new element is name-first but can be used as a description if ARIA claimed the name? It seems a bit strange, but maybe it works out in practice...<hN>
elements be involved at all? E.g. maybe<hN name>
instead of a new element?<legend>
,<summary>
,<caption>
; perhaps even<title>
or<label>
, although probably not. We should probably figure out why in the past we introduced new elements for<summary>
and<figcaption>
instead of reusing<legend>
or<caption>
, as that might give us some guidance on the general principles of reuse vs. new element(s).The text was updated successfully, but these errors were encountered: