? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
23 Dec 2020

Summary of Changes

@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

Reference https://developer.paciellogroup.com/blog/2017/07/short-note-on-aria-label-aria-labelledby-and-aria-describedby/

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

Testing Instructions

Create a module and make sure it has the html5 chrome

Actual result BEFORE applying this Pull Request

<div class="moduletable " aria-labelledby="mod-1">
	<h3 class="" id="mod-1">Title</h3>

Expected result AFTER applying this Pull Request

<div class="moduletable ">
	<h3>Module Title</h3>

With header class

<div class="moduletable ">
	<h3 class="example">Module Title</h3>

Not a div

<section class="moduletable " aria-labelledby="mod-1">
	<h3 id="mod-1">Title</h3>

Note

This is Partial Pull Request for Issue #31609

If approved I will make similar PR for the same mistakes in the cassiopeia chromes

avatar brianteeman brianteeman - open - 23 Dec 2020
avatar brianteeman brianteeman - change - 23 Dec 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Dec 2020
Category Layout
avatar brianteeman brianteeman - change - 23 Dec 2020
Labels Added: ?
avatar brianteeman
brianteeman - comment - 31 Dec 2020

@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

avatar HLeithner
HLeithner - comment - 31 Dec 2020

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 !==

avatar brianteeman
brianteeman - comment - 31 Dec 2020

thanks

avatar brianteeman
brianteeman - comment - 1 Jan 2021

Changes made as requested

avatar HLeithner
HLeithner - comment - 1 Jan 2021

Would it make sense to change the default value for "Module Tag" to section?

avatar HLeithner HLeithner - change - 1 Jan 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-01-01 12:35:14
Closed_By HLeithner
avatar HLeithner HLeithner - close - 1 Jan 2021
avatar HLeithner HLeithner - merge - 1 Jan 2021
avatar HLeithner
HLeithner - comment - 1 Jan 2021

Thanks

avatar brianteeman
brianteeman - comment - 1 Jan 2021

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

Add a Comment

Login with GitHub to post a comment