Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Update react-a11y-anchors-rule to include innerimage alt text as its text content #319

Closed
ipip2005 opened this issue Dec 6, 2016 · 0 comments · Fixed by #321
Closed
Assignees
Milestone

Comments

@ipip2005
Copy link
Collaborator

ipip2005 commented Dec 6, 2016

The text content of a link should not be only considered as the literal text in element.
Below example:

<a href="some_href">
  <img alt="somealt" />
</a>

The alt attribute will be read by screen reader, it should also be treated as part on the anchor info.

As a result

  1. The rule should pass when link ONLY has img tag and its alt attribute is equal or longer than 4 chars.

  2. The rule should pass when links that point to same HREFs have both same literal text and alt text.

  3. The rule should pass when links that point to different HREFs have either different literal text or alt text.

  4. The rule should fail when link when both link's literal text and alt text is shorter than 4 chars long.

  5. The rule should fail when links that point to different HREFs have same literal text and alt text.

  6. The rule should fail when links that point to same HREFs have different literal text or alt text.

@ipip2005 ipip2005 self-assigned this Dec 6, 2016
@ipip2005 ipip2005 closed this as completed Dec 6, 2016
@ipip2005 ipip2005 reopened this Dec 6, 2016
@ipip2005 ipip2005 changed the title Update react-a11y-anchors-rule to consider alt text as its text content Update react-a11y-anchors-rule to include innerimage alt text as its text content Dec 6, 2016
ipip2005 added a commit that referenced this issue Dec 6, 2016
The text content of a link should not be only considered as the literal text in element.
Below example:

<a href="some_href">
  <img alt="somealt" />
</a>
The alt attribute will be read by screen reader, it should also be treated as part on the anchor info.

As a result

The rule should pass when link ONLY has img tag and its alt attribute is equal or longer than 4 chars.

The rule should pass when links that point to same HREFs have both same literal text and alt text.

The rule should pass when links that point to different HREFs have either different literal text or alt text.

The rule should fail when link when both link's literal text and alt text is shorter than 4 chars long.

The rule should fail when links that point to different HREFs have same literal text and alt text.

The rule should fail when links that point to same HREFs have different literal text or alt text.
ipip2005 added a commit that referenced this issue Dec 7, 2016
The text content of a link should not be only considered as the literal text in element.
Below example:

<a href="some_href">
  <img alt="somealt" />
</a>
The alt attribute will be read by screen reader, it should also be treated as part on the anchor info.

As a result

The rule should pass when link ONLY has img tag and its alt attribute is equal or longer than 4 chars.

The rule should pass when links that point to same HREFs have both same literal text and alt text.

The rule should pass when links that point to different HREFs have either different literal text or alt text.

The rule should fail when link when both link's literal text and alt text is shorter than 4 chars long.

The rule should fail when links that point to different HREFs have same literal text and alt text.

The rule should fail when links that point to same HREFs have different literal text or alt text.
ipip2005 added a commit that referenced this issue Dec 7, 2016
The text content of a link should not be only considered as the literal text in element.
Below example:

<a href="some_href">
  <img alt="somealt" />
</a>
The alt attribute will be read by screen reader, it should also be treated as part on the anchor info.

As a result

The rule should pass when link ONLY has img tag and its alt attribute is equal or longer than 4 chars.

The rule should pass when links that point to same HREFs have both same literal text and alt text.

The rule should pass when links that point to different HREFs have either different literal text or alt text.

The rule should fail when link when both link's literal text and alt text is shorter than 4 chars long.

The rule should fail when links that point to different HREFs have same literal text and alt text.

The rule should fail when links that point to same HREFs have different literal text or alt text.
@HamletDRC HamletDRC added this to the 3.0.0 milestone Dec 12, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants