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

editorial: remove vague "meaningful" and parenthetical example #2069

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pkra
Copy link
Member

@pkra pkra commented Oct 20, 2023

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

@pkra pkra added the editorial a change to an example, note, spelling, grammar, or is related to publishing or the repo label Oct 20, 2023
index.html Outdated Show resolved Hide resolved
@pkra pkra changed the title editorial: remove vague "meaningful" editorial: remove vague "meaningful" and parenthetical example Oct 25, 2023
@pkra pkra requested a review from jnurthen October 27, 2023 14:10
@@ -5987,7 +5987,7 @@ <h4>Plain HTML or Polyfill DOM Result of the MathML Quadratic Formula</h4>
&lt;span&gt; Sample Content &lt;a href="...">let's go!&lt;/a> &lt;/span&gt;
</pre>
<p>In HTML, the <code>&lt;img&gt;</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>&lt;object&gt;</code> or <code>&lt;iframe&gt;</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>
Copy link
Member

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.

Suggested change
<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>

Copy link
Member Author

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.

Copy link
Contributor

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=""

Copy link
Member

@jnurthen jnurthen left a 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.

@pkra
Copy link
Member Author

pkra commented Nov 2, 2023

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial a change to an example, note, spelling, grammar, or is related to publishing or the repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What is non-meaningful text alternative?
4 participants