User tests: Successful: Unsuccessful:
@hans2103 introduced code with #29886 which correctly adds aria values to the module if it is using a landmark. However it also adds the value if it is a div and it has no effect here at all as assistive tech can not see it
Summary
If you use aria-label, aria-labelledby, or aria-describedby with any other elements (like div, span, p, blockquote, or strong etc.), they generally won’t work across all browser/assistive technology combinations.Confirmed that this is still valid advice with the author https://twitter.com/LeonieWatson/status/1335905663113900033
With this PR the aria values are only added if the module is NOT a div ie its a section etc
Additionally there was no check for the presence of a header class as a result by default there would be an empty class
Create a module and make sure it has the html5 chrome
<div class="moduletable " aria-labelledby="mod-1">
<h3 class="" id="mod-1">Title</h3>
<div class="moduletable ">
<h3>Module Title</h3>
<div class="moduletable ">
<h3 class="example">Module Title</h3>
<section class="moduletable " aria-labelledby="mod-1">
<h3 id="mod-1">Title</h3>
This is Partial Pull Request for Issue #31609
If approved I will make similar PR for the same mistakes in the cassiopeia chromes
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
Labels |
Added:
?
|
if you can tell me if it should be changed to !== from != or not then this can be tested and merged as its a silly bug that will trigger every a11y checker
in this case it's easy, you expect a string 'div' so any other value is wrong and it doesn't matter if the type is integer so you have to use !==
thanks
Changes made as requested
Would it make sense to change the default value for "Module Tag" to section?
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-01-01 12:35:14 |
Closed_By | ⇒ | HLeithner |
Thanks
Would it make sense to change the default value for "Module Tag" to section?
No not really
If approved I will make similar PR for the same mistakes in the cassiopeia chromes
Doing that now
@wilsonge @bembelimen if you can tell me if it should be changed to !== from != or not then this can be tested and merged as its a silly bug that will trigger every a11y checker