joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[6.0] - a11y - Contain page content by landmark

Open hans2103 opened this issue 4 months ago • 13 comments

Pull Request for no issue

Summary of Changes

It is best practice that all content is contained by a landmark. On the login page of administrator the sidebar is not contained by a landmark. This PR will fix this

Testing Instructions

  • Go to Joomla Administrator
  • Open Dev Tools
  • notice that element with className sidebar-wrapper is not contained by a landmark.
  • Apply the PR
  • Refresh login page
  • Open Dev Tools
  • notice that element with className sidebar-wrapper is contained in landmark <aside>

Landmark <aside> is chosen because sidebar is supplementary support info

Actual result BEFORE applying this Pull Request

        <div id="sidebar-wrapper" class="sidebar-wrapper">

Expected result AFTER applying this Pull Request

        <aside id="sidebar-wrapper" class="sidebar-wrapper" aria-labelledby="main-brand">

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:

  • [ ] No documentation changes for docs.joomla.org needed

  • [ ] Pull Request link for manual.joomla.org:

  • [ ] No documentation changes for manual.joomla.org needed

hans2103 avatar Aug 26 '25 19:08 hans2103

I agree with adding the landmark. Not sure about the arialabel. Will check in more detail later but I don't think it's needed or particularly helpful

brianteeman avatar Aug 26 '25 20:08 brianteeman

I would like to have a landmark here and get rid of this ugly "missing landmark" error. But am not sure if <aside is correct. Semantic meaning is "content which is relaed to the main content and supports it". We can define modules - there we know when the module is related to the main content. But sidebar could be everything. Would be interesting to know if the <aside helps blind users and has a meaning

chmst avatar Aug 26 '25 20:08 chmst

Aside means it is complimentary to the main region but I wonder if it can be considered as complimentary as it has the page h1 in it.

brianteeman avatar Aug 26 '25 20:08 brianteeman

The <aside> HTML element represents a portion of a document whose content is only indirectly related to the document's main content. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/aside

This suggests it's not the correct landmark region to use here

brianteeman avatar Aug 26 '25 20:08 brianteeman

A <div role="complementary" could match.

chmst avatar Aug 26 '25 20:08 chmst

A <div role="complementary" could match.

that is the exact same thing as aside https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/complementary.html

brianteeman avatar Aug 26 '25 21:08 brianteeman

Not sure about the arialabel. Will check in more detail later but I don't think it's needed or particularly helpful

I was surprised that the label would identify the text as the referred id is to the div and not the individual text. So that arial label is both the h1 and the h2

In general a region only needs a label if there are more than one on the page but i dont suppose it harms having one anyway.

I wonder if this is the real main region on the page and its the login that is either complimentary or region https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/region.html

brianteeman avatar Aug 26 '25 21:08 brianteeman

My 2 cents here. As the h1and h2 are in the sidebar-wrapper thingy, I think the aside should be for the <div id="sidebar"> .

But, besides getting rid of the error in automatic detection tools. Does this help to anyone? Everytime I investigate about landmarks I end giving up because of the scarce support hey have in browsers and screen readers.

carcam avatar Aug 28 '25 13:08 carcam

I have tested this item :white_check_mark: successfully on a692226b5cd71909d57ca4153ac486592b7ec517


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45988.

ceford avatar Sep 17 '25 08:09 ceford

I have tested this item :white_check_mark: successfully on a692226b5cd71909d57ca4153ac486592b7ec517

I also looked up https://www.w3schools.com/accessibility/accessibility_landmarks.php It tells that the

ThomasFinnern avatar Nov 28 '25 18:11 ThomasFinnern

element "aside" is missing in above comment


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45988.

ThomasFinnern avatar Nov 28 '25 18:11 ThomasFinnern

I just dont see how a region with the h1 inside it can ever be considered to be complimentary

brianteeman avatar Nov 28 '25 18:11 brianteeman

I just dont see how a region with the h1 inside it can ever be considered to be complimentary

fair point. Any suggestions how to get rid of this ugly "missing landmark" error?

hans2103 avatar Dec 02 '25 07:12 hans2103

Thank you for the work on this, pushed to 6.1 as not fixing a bug.

Bodge-IT avatar Dec 17 '25 07:12 Bodge-IT