Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here's an snippet of the html produced on /admin/people/permissions:
<td class="checkbox" title="authenticated user : administer news feeds"><div class="form-item form-type-checkbox form-item-2-administer-news-feeds">
<input type="checkbox" name="2[administer news feeds]" id="edit-2-administer-news-feeds" value="administer news feeds" class="form-checkbox" />
</div>
</td>
The way it is currently, the Orca screen-reader does not read the title attribute (other screen-readers may not either). This can make it difficult for someone relying on Orca to know what the check-box does, and could be considered a failure of WCAG 2 3.3.2.
However, Orca will read the title attribute if it is in the control's tag like this:
<td class="checkbox"><div class="form-item form-type-checkbox form-item-2-administer-news-feeds">
<input type="checkbox" name="2[administer news feeds]" id="edit-2-administer-news-feeds" title="authenticated user : administer news feeds" value="administer news feeds" class="form-checkbox" />
</div>
</td>
Comment | File | Size | Author |
---|---|---|---|
#8 | user_permissions_labels-2.patch | 987 bytes | mgifford |
#8 | screen-capture-38.png | 96.79 KB | mgifford |
#3 | user_permissions_labels.patch | 854 bytes | mgifford |
Comments
Comment #1
mgiffordI think that's going to be tied to this issue - #504962: Provide a compound form element with accessible labels
I've looked briefly at introducing it in modules/user/user.admin.inc with functions user_admin_permissions() & theme_user_admin_permissions().
Comment #2
Everett Zufelt CreditAttribution: Everett Zufelt commentedInterestingly this was one of the first things I noticed about Drupal when I started using it. Funny that a bug never was filed.
The trick with using a fieldset is that a fieldset cannot be used across cells of a table.
Comment #3
mgiffordOk, so we can actually add this in as a label fairly easily now.
This just needs to be added to the checkbox array before it is rendered:
I can't see any reason to have the title in the td tag in which case the next row in the array should be modified so that the title isn't output there:
Any thoughts on this?
Comment #4
mgiffordOh yes, not only does this need review, but I wanted to check if there are other places where this type of table of checkboxes might produce this type of inaccessible form.
Comment #5
tomdavidson CreditAttribution: tomdavidson commentedIn review of Patch #3:
Can you provide more info on recreating?
Could a grep of the code base identify other sources of the title attribute outside the control tag?
Comment #6
YaxBalamAhaw CreditAttribution: YaxBalamAhaw commentedadminister-news-feeds was just an example. You probably didn't see it because the aggregator module was not enabled Another example would be:
should be:
Every table cell in admin/people/permissions has a title attribute, when it should be the checkbox that has the attribute.
I can't remember seeing any other table like the permissions one (doesn't mean there aren't any). admin/modules is similar, but every checkbox has a label, so there isn't an accessibility problem there.
Comment #7
tomdavidson CreditAttribution: tomdavidson commentedThank you and I apologize - I did enable the aggregator module, but it must have been on a different patch Drupal instance. I see both of your examples now.
I am board with the patch not fixing everything - especially if the other issues are unknown and it is reasonable to think they might not exist.
Pre-patch I have:
Post-patch I have:
So the invisible label is being rendered as described. What is the new line break above
?
Comment #8
mgifford@YaxBalamAhaw - I'm pretty sure that either a title with the checkbox or a label would work as well for accessibility. This the review with the label:
I've got it up in my sandbox - http://drupal7.dev.openconcept.ca/admin/people/permissions
@tomdavidson - thanks for this review
Pass 3: comments? I don't think it needs it. It hasn't elsewhere.
Pass 4: topical? I don't know of any places where this occurs. Not sure if there's an easy way to grep through it though either.. Open to suggestions though. I use grep a lot.
Pass 5: does it work? it's up in my sandbox. It's an issue for all permission checkboxes on the permissions page.
I added a new patch to remove the title from the <td>
Comment #9
tomdavidson CreditAttribution: tomdavidson commented@mgifford - Hope I didnt give the wrong idea, those 5 questions were the ones I had asked myself and then tried to answer as part of the review. I will be more clear on future reviews.
Patch #8 is verified to work as described. There is still the extra empty line above the
in the rendered HTML. Looking at the rest of the page source I see similar empty lines, so under the assumption that is not significant or outside the scope of the patch, changed to reviewed & tested.
Comment #10
mgifford@tomdavidson - I liked your 5 point process. I was trying to respond to the points & just wanted to echo them.
Thanks for marking this RTBC!
Comment #11
tomdavidson CreditAttribution: tomdavidson commentedahh ok. well, in that case I better give the source of what i was trying to do: http://webchick.net/6-pass-patch-reviews
Comment #12
mgiffordahh, very useful, thanks!
Comment #13
Dries CreditAttribution: Dries commentedIn case of English text, we don't need to use ' : ' but can instead use ': ' (no leading space). I've fixed that in the patch, and committed it to CVS HEAD. Thanks.