-
Notifications
You must be signed in to change notification settings - Fork 118
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
editorial: remove vague "meaningful" and parenthetical example #2069
base: main
Are you sure you want to change the base?
Conversation
Following up on #2062.
@@ -5987,7 +5987,7 @@ <h4>Plain HTML or Polyfill DOM Result of the MathML Quadratic Formula</h4> | |||
<span> Sample Content <a href="...">let's go!</a> </span> | |||
</pre> | |||
<p>In HTML, the <code><img></code> <a>element</a> is treated as a single entity regardless of the type of image file. Consequently, using <code>role="none"</code> or <code>role="presentation"</code> on an HTML <code>img</code> is equivalent to using <code>aria-hidden="true"</code>. In order to make the image contents accessible, authors can embed the object using an <code><object></code> or <code><iframe></code> <a>element</a>, or use inline <abbr title="Scalable Vector Graphics">SVG</abbr> code, and follow the accessibility guidelines for the image content.</p> | |||
<p>Authors SHOULD NOT provide a meaningful text alternative (for example, use <code>alt=""</code> in HTML) when the <code>none</code>/<code>presentation</code> role is applied to an image.</p> | |||
<p>Authors SHOULD NOT provide a text alternative when the <code>none</code>/<code>presentation</code> role is applied to an image.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this was trying to say that.
I think it was saying don't use alt="something"
But it is fine (although redundant) to use alt="" with role="none" as they essentially do the same thing. Indeed the example below does exactly that.
<p>Authors SHOULD NOT provide a text alternative when the <code>none</code>/<code>presentation</code> role is applied to an image.</p> | |
<p>Authors SHOULD NOT provide a non empty text alternative when the <code>none</code>/<code>presentation</code> role is applied to an image.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take the point regarding the following example but since this will get flagged by nu validator already, we should perhaps remove it.
I find the double negation unnecessarily complicated. Since empty aria-label cause validation errors, I think it wouldn't reduce confusion as much so I think it's better as is. But it's not really that important to me - happy to merge the suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I don't think alt="" role="none"
should fail the validator. I think it should be okay to do this.
It should also be fine to do role="none"
or alt=""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we really don't intend to allow alt="" on role="none" then fine - but I'm not sure that is the intent. If it is then we need to change the example too.
E.g., nu validator flags it as error "An img element which has an alt attribute whose value is the empty string must not have a role attribute." |
Following up on #2062.
Closes #2068
In this negation, it seems very vague (what is non-meaningful-but-not-empty alt?) and I think a clear "SHOULD NOT add alt" is better.
Otherwise, if there's a use case for "non-meaningful text alternative" then perhaps this can be added to the parenthetical example.
To further reduce confusion, the parenthical example using an empty alt attribute was also removed.
Preview | Diff