Problem/Motivation
The Powered-by-Drupal block has a role="complementary"
to treat it as a landmark region for assistive technology.
This is overkill - the block just contains a short sentence and a link.
If there are too many landmark regions, their usefulness is diluted. Landmark regions are intended to denote the main layout regions of the page (e.g. header, footer, main menu, main content, sidebar), or important controls which the user is likely to need to find quickly (e.g. log-out, search, notifications, or shopping cart summary).
The powered-by-Drupal block doesn't count as any of these. It's effectively an advert for the CMS, which meansit is very unlikely to be relevant to the content of the page at all. If a local authority has a page about recycling facilities, the fact that the page is powered by Drupal isn't an important thing for users to locate.
Proposed resolution
Remove the role attribute from the Powered-by-Drupal block.
Remaining tasks
- DONE. Remove role attribute.
- DONE. Update tests.
User interface changes
Reduce over-use of landmark roles.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff-3155462-2-4.txt | 1.08 KB | andrewmacpherson |
#4 | 3155462-4.patch | 1.64 KB | andrewmacpherson |
#2 | 3155462-2.patch | 425 bytes | andrewmacpherson |
Comments
Comment #2
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedComment #4
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedThis patch removes the associated test too.
Also, this comment in
StandardTest.php
is nonsense; that's not what it is testing at all...The complementary landmark region role was added in #1183042: Regression: Add WAI-ARIA roles to Core blocks. Looking back at the list of roles added by that issue, it's overblown. It amounts to "let's treat every block as a landmark region" without considering whether they would actually be helpful, or the fact that most of our theme regions also have a landmark role. Drupal core is using landmark region roles gratuitously.
I wondered whether to expand the scope of this issue to removing other unnecessary landmark roles, but I think it would be quicker to clean them up with small issues, one at a time.
Comment #5
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedComment #6
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedThis is a quick win. It's a good one to review during the Accessibility Bug Bash during DrupalCon Global 2020.
Comment #7
NickGee CreditAttribution: NickGee as a volunteer commentedTested as working:
* #4 patch applies cleanly
* web/core/profiles/standard/tests/src/Functional/StandardTest.php passes
* complementary role removed from `powered by Drupal` block
Comment #8
theMusician CreditAttribution: theMusician at Western Washington University commentedI can confirm what NickGee wrote.
Comment #9
alexpottReading https://www.w3.org/WAI/PF/aria/roles#complementary says
So yep this is wrong.
Committed 47a7b73 and pushed to 9.1.x. Thanks!
Going to ping other committers about backporting this.
Comment #11
alexpott@catch, @larowlan and @lauriii all +1 the backport to 8.9.x.