Skip to content
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

"may" instead of "must" in step 4 of <input type=image> #270

Closed
cblouch opened this issue Dec 3, 2019 · 7 comments · Fixed by #279
Closed

"may" instead of "must" in step 4 of <input type=image> #270

cblouch opened this issue Dec 3, 2019 · 7 comments · Fixed by #279

Comments

@cblouch
Copy link

cblouch commented Dec 3, 2019

Seems like this should be a "must" and drop step 5. As written it enables inconsistent behavior between browsers. In a quick test I found:

Safari OSX VoiceOver – “Submit Button”
Chrome OSX VoiceOver – “Submit Button”
Chrome Win10 NVDA – “Button Submit”
Chrome Win10 JAWS – “Submit Button”
Edge Win10 NVDA – “Button Blank”
Edge Win10 JAWS – “Button Blank”
FF Win10 NVDA – “Button Submit Query”
FF Win10 JAWS – “Submit Query Button”

If I am writing a test for whether a image input lacks an accessible name and have something like the ACT-R failed example 1:
https://github.com/act-rules/act-rules.github.io/blob/develop/_rules/image-button-accessible-name-59796f.md
<input type="image" name="submit" src="button.gif" />
I can't be sure if this is a fail or not because some browsers "may" supply an accessible name and some (Edge) will not. As it is today, with a test flagging or passing the above markup, I'll be generating false positives for somebody. In other words, the spec is encouraging browsers to not have interoperability.

@cblouch
Copy link
Author

cblouch commented Dec 5, 2019

Stepping back a bit, I question whether step 4 is valid at all. For an input like:
<input type="image" src="foo.gif" />
The user agent will have no way of knowing the meaning of the image used or the purpose of the control. Supplying "submit query" as the accessible name without thought is functionally a generic repair best left for ATs, if done at all. The string would be better set to "I don't know what this is".
In short, step 4 should be removed. The user agent should not be attempting repairs and, especially a repair using generic boilerplate text. A side effect of this is that automated testing tools that follow the spec will pass this construct as having a perfectly valid accessible name, sweeping an author error under the rug.

@JAWS-test
Copy link

Step 4 is OK because input type=image is a submit button according to the specification https://html.spec.whatwg.org/multipage/input.html#image-button-state-(type=image)

@JAWS-test
Copy link

May is also OK. Alt attribute is required. No alt is a failure. Nevertheless the browser can decide to repair errors made by the author of the source code as in many other cases. But image button without alt is wrong

@scottaohara
Copy link
Member

I think it's worth investigating dropping step 5, especially with Edge moving to chromium. In doing so, Edge will no longer not provide a fallback string, as chromium edge falls back to a "submit" string if no accessible name is provided.

@cblouch per your comment in the linked thread,

I believe that in this case the UA supplied string has no way of knowing what the image is nor the purpose of the input

Being an input type=image is a version of a submit button, it seems quite reasonable that user agents fall back to the same default strings as an input type=submit without an author provided accessible name. Personally, i would consider it problematic for authors to be providing a submit button with alternative text that didn't indicate it was a submit button...

@JAWS-test
Copy link

Personally, i would consider it problematic for authors to be providing a submit button with alternative text that didn't indicate it was a submit button...

I'm not sure if it can also be allowed to use an input type=image like an input type=button. According to the specification, input type=image is a submit button. This would also mean that it was only possible to use graphical submit buttons, but no graphical type=button/reset buttons, until the button element was introduced.

@cblouch
Copy link
Author

cblouch commented Dec 6, 2019

So combining the three threads, it sounds like its reasonable that browser should treat image inputs in a similar manner as submit or reset and provide a fallback string. I think the argument is stronger in the submit and reset cases, but still reasonable. Given that, the open bits are "may" vs. "must" on step 4 and whether step 5 is then needed at all. If all the browsers are (or will soon) be providing fallback text then maybe the spec should pave the cowpath and adopt "must" because the browsers are all doing it this way anyway. If step 4 goes from may to must then step 5 is obviously no longer needed.

@scottaohara
Copy link
Member

seems we should reuse/revise wording from input type=submit, e.g.

Otherwise, user agents MUST provide a localized string of the word "submit" or words "submit query".

Re: step 5, I don't think this can be removed after all. For instance, even with a "must" if an author were to set alt="", then there would still be no accessible name exposed. So the wording of step 5 "If none of the above yield a usable text string there is no accessible name. " still applies.

scottaohara added a commit that referenced this issue Feb 5, 2020
closes #270

purposefully staying away from “MUST”, but removing the ‘may’ in this commit to stay consistent with other input button types.
scottaohara added a commit that referenced this issue May 29, 2020
closes #270

purposefully staying away from “MUST”, but removing the ‘may’ in this commit to stay consistent with other input button types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants