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
What should happen if label element contains child elements #300
Comments
The problem on the page has nothing to do with the span. The text content of a label is always correctly recognized as a label, no matter how it is nested. The error is that the label was marked with display:none |
If I remove the `display:none' the label is calculated correctly in Chrome and Firefox, but not Safari - it still shows as an empty string. |
check the accessibility API title property, that is where the acc name shows up for labels on Mac as i recall |
I have only tested it in Firefox and Chrome, as I unfortunately do not have Safari. For the output of hidden labels see: w3c/accname#57 |
The
Chrome: the Accessibility tab in DevTools shows the calculated name as the empty string and shows the |
However, this has changed the content of the issue. Can you please change the title because the question in the title has been answered, right? |
it is in fact the " |
This code has a
label
whose only content is aspan
containing nested label text. The HTML content model for the label element allows phrasing content (other than descendant label elements).https://www.breckland.gov.uk/
All of the mainstream browsers ignore the
span
contents nested inside thelabel
.search-field
aslabel=""
<empty string>
for the accessible nameplaceholder
attribute as the accessible nameThis looks like a bug, but it's not clear what the correct behaviour is after reading accname and html-aam.
The spec says:
and
There seems to be an an unintended difference between 5.1.1 and 5.7.1. I also can't see anywhere that explicitly specifies how to calculate the accessible name for
label
. Step D in accname just refers back to host languageThe text was updated successfully, but these errors were encountered: