Quantcast
Viewing all articles
Browse latest Browse all 295818

"Add new comment" and "@count comments" links are not following accessibility good practices

Problem/Motivation

Since Drupal 7, the "Read more" links added by the core on the nodes teasers have been made accessible by appending them a visually-hidden indication of the node title to read more about. The same thing should be done on the "Add new comment" and "@count comments" links provided by the comment module.

This is important because screen readers users sometime navigate by jumping from link to link. If the links titles are such generic, they have no clue about where they are going to land.

Steps to reproduce

  1. Install Drupal standard
  2. Create an article, published ans promoted to front page, with title "Blah"
  3. Go to your article and add a comment
  4. Have a look at your front page source code

Expected result: <a href="/node/1#comments" title="Jump to the first comment." hreflang="en">1 comment<span class="visually-hidden"> on Blah</span></a> and <a href="/node/1#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment<span class="visually-hidden"> about Blah</span></a>

Current result: <a href="/node/1#comments" title="Jump to the first comment." hreflang="en">1 comment</a> and <a href="/node/1#comment-form" title="Share your thoughts and opinions." hreflang="en">Add new comment</a>

Proposed resolution

Use the same trick than "Read more" links.

Remaining tasks

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Create a patchInstructionsDone
Add automated testsInstructions
Manually test the patch NoviceInstructions
Add steps to reproduce the issueNoviceInstructionsDone
Embed before and after screenshots in the issue summary NoviceInstructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standardsInstructions

User interface changes

Nothing visual. Screen readers are going to find more context on "Add new comment" and "@count comments" links.

API changes

None.

Data model changes

None.


Viewing all articles
Browse latest Browse all 295818

Trending Articles