You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTML-AAM - test and update name calc for labelable elements #29
test the following elements (where label not already included in name calc) and update where necessary to reflect implementations.
list of labelable elements in HTML5 includes
button input (if the type attribute is not in the hidden state)keygen meter output progress select textarea
Here's an attempt to consolidate the accessible name computation for labelable elements (button, input (if the type attribute is not in the Hidden state), meter, output, progress, select, and textarea).
I think the following computation covers all labelable elements, but I'm not certain it is easier to understand than the current or some other approach. What do you think @stevefaulkner@asurkov@boggydigital ?
Use aria-label or aria-labelledby
Otherwise, use associated label element(s)
Otherwise,
if input@type="image",
i. use alt attribute
ii. otherwise, use value attribute
iii. otherwise, MAY use localized version of string "submit"
if input@type="button|reset|submit",
i. use value attribute
ii. otherwise, MUST use localized version of string "reset" if type="reset", and localized version of string "submit" if type="submit"
if button, meter, output, or progress, use the element's subtree
Otherwise, use title attribute
Otherwise, no accessible name
Note that the accessible description computations for these elements can easily be similarly consolidated.
Here are the four individual computation groups or sequences consolidated above. Perhaps I've got one or more of these wrong. In particular, I'm assuming that the value attribute is not a good option for accessible name with the meter and progress elements.
Group A
For the following elements:
input@type="text"
input@type="search"
input@type="tel"
input@type="url"
input@type="email"
input@type="password"
input@type="date"
input@type="month"
input@type="week"
input@type="time"
input@type="datetime-local"
input@type="number"
input@type="range"
input@type="color"
input@type="checkbox"
input@type="radio"
input@type="file"
textarea
select
The accessible name is computed as follows:
aria-label or `aria-labelledby'
otherwise label
otherwise title attribute
otherwise no accessible name
Group B
For the following elements:
input@type="submit"
input@type="reset"
input@type="button"
The accessible name is computed as follows:
aria-label or `aria-labelledby'
otherwise label
otherwise value attribute
otherwise localized version of string "reset" for type="reset" and localized version of string "submit" for type="submit"
otherwise title attribute
otherwise no accessible name
Group C
For the following element:
input@type="image"
The accessible name is computed as follows:
aria-label or `aria-labelledby'
otherwise label
otherwise alt attribute
otherwise value attribute
(optional) otherwise localized version of string "submit"
many other PRs are open to fill in the form elements that aren't listed
there have been other updates since this issue was created that filled in other gaps.
what we need is to remove the "other form elements" and just list out the remaining elements that aren't in the spec yet. may just be meter and progress, but we'll double check.
Activity
jasonkiss commentedon Oct 12, 2016
From @stevefaulkner on February 21, 2016 19:0
test file http://thepaciellogroup.github.io/AT-browser-tests/test-files/label.html
jasonkiss commentedon Feb 27, 2018
Here's an attempt to consolidate the accessible name computation for labelable elements (
button,input(if thetypeattribute is not in the Hidden state),meter,output,progress,select, andtextarea).I think the following computation covers all labelable elements, but I'm not certain it is easier to understand than the current or some other approach. What do you think @stevefaulkner @asurkov @boggydigital ?
aria-labeloraria-labelledbylabelelement(s)if
input@type="image",i. use
altattributeii. otherwise, use
valueattributeiii. otherwise, MAY use localized version of string "submit"
if
input@type="button|reset|submit",i. use
valueattributeii. otherwise, MUST use localized version of string "reset" if
type="reset", and localized version of string "submit" iftype="submit"if
button,meter,output, orprogress, use the element's subtreetitleattributeNote that the accessible description computations for these elements can easily be similarly consolidated.
Here are the four individual computation groups or sequences consolidated above. Perhaps I've got one or more of these wrong. In particular, I'm assuming that the
valueattribute is not a good option for accessible name with themeterandprogresselements.Group A
For the following elements:
input@type="text"input@type="search"input@type="tel"input@type="url"input@type="email"input@type="password"input@type="date"input@type="month"input@type="week"input@type="time"input@type="datetime-local"input@type="number"input@type="range"input@type="color"input@type="checkbox"input@type="radio"input@type="file"textareaselectThe accessible name is computed as follows:
aria-labelor `aria-labelledby'labeltitleattributeGroup B
For the following elements:
input@type="submit"input@type="reset"input@type="button"The accessible name is computed as follows:
aria-labelor `aria-labelledby'labelvalueattributetype="reset"and localized version of string "submit" fortype="submit"titleattributeGroup C
For the following element:
input@type="image"The accessible name is computed as follows:
aria-labelor `aria-labelledby'labelaltattributevalueattributetitleattributeGroup D
For the following elements:
buttonmeteroutputprogressThe accessible name is computed as follows:
aria-labelor `aria-labelledby'labeltitleattributejasonkiss commentedon Mar 7, 2018
See https://rawgit.com/w3c/html-aam/jasonkiss-issue-29/#accessible-name-and-description-computation for a 'live' version of the changes I propose for the Acc Name and Desc section.
asurkov commentedon Mar 8, 2018
@jasonkiss I like it. Is there a diff I can run through and comment?
stevefaulkner commentedon Mar 8, 2018
jasonkiss commentedon Mar 8, 2018
@asurkov
the branch: https://github.com/w3c/html-aam/tree/jasonkiss-issue-29
the relevant commit: f348adf?diff=split
asurkov commentedon Mar 13, 2018
Thank you. I run through the diff and left comments here and there. Hope it makes sense.
scottaohara commentedon Feb 7, 2025
many other PRs are open to fill in the form elements that aren't listed
there have been other updates since this issue was created that filled in other gaps.
what we need is to remove the "other form elements" and just list out the remaining elements that aren't in the spec yet. may just be meter and progress, but we'll double check.