Skip to:
Content

Opened 5 months ago

Closed 5 months ago

#3220 closed enhancement (fixed)

Accessibility: Avoid Adjacent Duplicate Links for Topic Author

Reported by: dcavins Owned by: johnjamesjacoby
Milestone: 2.7 Priority: normal
Severity: minor Version: trunk
Component: General Keywords: has-patch
Cc: mercime

Description

When a user's avatar is inserted before the user's name in the topic or forum loops, each item is individually wrapped in a link with the same destination. WCAG prefers that these items be contained within a single link: https://www.w3.org/TR/2014/NOTE-WCAG20-TECHS-20140311/H2

I've attached a patch that updates the HTML output from:

<a href="http://bptest.local/members/admin/" title="View Cap’n's profile" class="bbp-author-avatar">
	<img alt="" src="//www.gravatar.com/avatar/3665d8d0d1b0eb151f8e941070fad664?s=14&amp;r=g&amp;d=mm" srcset="//www.gravatar.com/avatar/3665d8d0d1b0eb151f8e941070fad664?s=14&amp;r=g&amp;d=mm 2x" class="avatar avatar-14 photo" width="14" height="14">
</a>&nbsp;
<a href="http://bptest.local/members/admin/" title="View Cap’n's profile" class="bbp-author-name">Cap’n</a>

to

<a href="http://bptest.local/members/admin/" title="View Cap’n's profile" class="bbp-author-link">
	<span class="bbp-author-avatar">
		<img alt="" src="//www.gravatar.com/avatar/3665d8d0d1b0eb151f8e941070fad664?s=14&amp;r=g&amp;d=mm" srcset="//www.gravatar.com/avatar/3665d8d0d1b0eb151f8e941070fad664?s=14&amp;r=g&amp;d=mm 2x" class="avatar avatar-14 photo" width="14" height="14">
	</span>&nbsp;
	<span class="bbp-author-name">Cap’n</span>
</a>

Thanks for considering this enhancement.

Attachments (1)

3220.1.diff (6.4 KB) - added by dcavins 5 months ago.
Replace adjacent duplicate links.

Download all attachments as: .zip

Change History (3)

@dcavins
5 months ago

Replace adjacent duplicate links.

#1 @johnjamesjacoby
5 months ago

  • Milestone changed from Awaiting Review to 2.7
  • Owner set to johnjamesjacoby

#2 @johnjamesjacoby
5 months ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6868:

Accessibility: Avoid back-to-back author links.

This change ensures that avatar and display-name links are wrapped in a shared anchor, instead of each with their own.

Includes a few test changes to better suit our intentions of verifying valid & accessible HTML output.

Fixes #3220. Props dcavins.

Note: See TracTickets for help on using tickets.