Open dandclark opened 4 months ago
If adding a step to strip the whitespace from the accumulated text so that it will correctly fall back to the aria-label, then we should add it.
Do we think this is the case?
I don't like that there's no way to force no name. For example, if you have a title attribute on a
On Thu, Jul 11, 2024 at 1:25 PM Melanie Sumner @.***> wrote:
If adding a step to strip the whitespace from the accumulated text so that it will correctly fall back to the aria-label, then we should add it.
Do we think this is the case?
— Reply to this email directly, view it on GitHub https://github.com/w3c/accname/issues/233#issuecomment-2223492897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKQAZRUCWSDS5ZYAH7HZYDZL25XPAVCNFSM6AAAAABEXCM77SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRTGQ4TEOBZG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
IOW, IMO, aria-label="", aria-label=" " or aria-labelledby pointing to empty/whitespace text should all cause there to be no name on something. There can be reasons to do that.
On Thu, Jul 11, 2024 at 1:38 PM Aaron Leventhal @.***> wrote:
I don't like that there's no way to force no name. For example, if you have a title attribute on a
, and have that info in another way, you might not want it to be converted to a name. I had an example of this the other day, where the title was only there because css text-ellipsis sometimes truncated things visibly (but not in the a11y tree).On Thu, Jul 11, 2024 at 1:25 PM Melanie Sumner @.***> wrote:
If adding a step to strip the whitespace from the accumulated text so that it will correctly fall back to the aria-label, then we should add it.
Do we think this is the case?
— Reply to this email directly, view it on GitHub https://github.com/w3c/accname/issues/233#issuecomment-2223492897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKQAZRUCWSDS5ZYAH7HZYDZL25XPAVCNFSM6AAAAABEXCM77SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRTGQ4TEOBZG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
FWIW I think we're twisting ourselves up a little bit.
The purpose of recognizing white space in an accessible name or description was so that we didn't have run-on words.
If the whitespace to be added does not serve that purpose, why add it?
Then again, can we tell if it would prevent a run-on scenario?
I'm looking at the test case
"button's hidden referenced name (visibility:hidden) with hidden aria-labelledby traversal falls back to aria-label"
in the WPT accname/name/comp_label.html.One problem is that the
span4
element ID is duplicated from the previous test; I'm fixing that in https://github.com/web-platform-tests/wpt/pull/45117.In Chromium, the test still fails because Blink includes the whitespace under
span4
asspan4
's a contribution to the LabeledBy Recursion in step 2B LabeledBy. So we end up using that whitespace as the computed name, instead of falling back to thearia-label
, and the test fails.If I delete the whitespace under
span4
then the test passes.The spec language doesn't say anything here about not counting whitespace:
So per the spec, Chromium's behavior seems to be correct and the test incorrect, but I don't think that's the intent. Should the spec have a step to strip whitespace from the accumulated text in step iii before deciding whether not to return it?