back the ID and aria-labelled-by with JS

Created on 5 June 2024, 12 months ago

Problem/Motivation

This is folow up issue from https://www.drupal.org/project/drupal/issues/3393400#comment-15627607 Evaluate adding Nightwatch tests Active

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Postponed

Version

11.0 🔥

Component
Navigation 

Last updated 21 days ago

No maintainer
Created by

🇷🇸Serbia finnsky

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • 🇷🇸Serbia finnsky

    I was saying that these headings were there from the very beginning of the project and I don't think anyone ever seriously looked into the semantics or accessibility of the headings. That's why we removed them.

    What we really need is a quality review of accessibility and structure. And depending on the review results, add or remove headings. I'm not sure they are needed at all.

    @ckrina wrote in #22

    Removing the "prove the need" because it's proven already that this is necessary to fix #3438976: [PP-2] Implement a caching strategy for the menu links. Discussing this with @plopesc.

    But I don't understand how caching is related to accessibility and semantics

  • 🇪🇸Spain plopesc Valladolid

    They're not directly related to caching, but the way it was supposed to cache the navigation HTML markup in local storage to not serve it in every request was not compatible with having IDs in the navigation HTML markup.

    All the discussion and the reasoning is available in 📌 Implement a caching strategy for the menu links Active .

  • 🇺🇸United States katannshaw Kansas

    It appears to me that the changes in commit b99b9552 and commit d68ff2c9 are causing a11y issues because when there’s more than one menu on the page, each nav needs to have a unique label per WCAG 2.2 1.3.1: Info and Relationships (Level A) and 4.1.2: Name, Role, Value (Level A)

    I'm also seeing a related accessibility issues in that each menu should contain a wrapping <nav> element

    The unique aria-labelledby attribute should be added to the <nav> element instead of the <ul> element. Per W3C ARIA Landmark Example > Navigation Landmark, here is how a menu should be rendered when there's more than one menu on the page:

    <nav aria-labelledby="nav1">
      <h2 id="nav1">Title for navigation 1<h2>
      <ul>
        <li><a href="page11.html">Link 1</a></li>
        <li><a href="page12.html">Link 2</a></li>
        .....
      </ul>
    </nav>
    <nav aria-labelledby="nav2">
      <h2 id="nav2">Title for navigation 2<h2>
      <ul>
        <li><a href="page11.html">Link 1</a></li>
        <li><a href="page12.html">Link 2</a></li>
        .....
      </ul>
    </nav>
    

    Other resources explaining this reasoning:

    Hope it helps.

  • Merge request !11122Test with aria-label #3452724 → (Open) created by finnsky
  • Pipeline finished with Failed
    4 months ago
    Total: 698s
    #416299
  • 🇷🇸Serbia finnsky

    One backend fix need to be applied here. We can go with here.

  • First commit to issue fork.
  • Pipeline finished with Canceled
    4 months ago
    Total: 242s
    #416847
  • Pipeline finished with Canceled
    4 months ago
    Total: 115s
    #416849
  • Pipeline finished with Failed
    4 months ago
    Total: 370s
    #416851
  • Pipeline finished with Failed
    4 months ago
    Total: 372s
    #417650
  • Pipeline finished with Failed
    4 months ago
    Total: 78s
    #417757
  • 🇪🇸Spain plopesc Valladolid
  • Pipeline finished with Success
    4 months ago
    #417770
  • 🇪🇸Spain plopesc Valladolid

    Updated the issue summary to reflect the last requirements from a11y team.

    Tested locally and worked as expected.

    Fixed the Kernel tests failing due to conflicts between DomDocument::loadHtml and HTML5 tags (https://www.php.net/manual/en/domdocument.loadhtml.php)

    I think this is ready for final review.

  • 🇪🇸Spain gxleano Cáceres

    Review steps

    1. Install Drupal 11.x.
    2. Enable Navigation module.
    3. Check menus and inspect the html for them.

    See evidences:

    Content Menu

    Administration Menu

    Help Menu

    Everything works as expected ✅

    Moving to RTBC.

  • 🇨🇦Canada m4olivei Grimsby, ON
  • 🇨🇦Canada m4olivei Grimsby, ON

    Addressed some duplication in the navigation titles for non-sighted users. See last comment and commit.

    Ready for a re-review and accessibility review.

  • Pipeline finished with Success
    3 months ago
    Total: 830s
    #437217
  • 🇺🇸United States smustgrave

    Went to review as I got some accessibility knowledge/tools. But issue summary appears incomplete in that the proposed solution just says "Implement this" but MR contains a number of changes so think solution should be properly flushed out.

    Will try and pick up once complete.

  • 🇨🇦Canada m4olivei Grimsby, ON

    Good point @smustgrave. Updated the issue description. Back to Needs Review.

  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇨🇦Canada m4olivei Grimsby, ON

    Merged the latest from the 11.x branch. Back to Needs review.

  • Pipeline finished with Success
    3 months ago
    Total: 448s
    #441986
  • 🇺🇸United States smustgrave

    Can we get a CR for the template changes? In case some theme have overridden the templates

  • 🇬🇧United Kingdom catch

    The module is still experimental and templates are considered @internal, so I don't think we need a CR here - doesn't hurt to have one but not a blocking issue, whereas it looks like an accessibility review still is.

  • Pipeline finished with Success
    about 2 months ago
    Total: 604s
    #461933
  • Status changed to Needs review about 2 months ago
  • 🇺🇸United States katannshaw Kansas

    @finnsky @m4olivei Thank you for rebuilding the tugboat. The Accessibility team, including @rkoller and I, tested the latest work. I just now tested the latest tugboat against the Apple VoiceOver screen reader and this is what I'm seeing in its rotor output and the HeadingsMap browser extension. I'm seeing the following (with screenshots):

    Headings: Toolbars have three nav menus with "Administration" heading labels

    Landmarks: The toolbar's landmarks contains some generic "Navigation" titles, likely because they have empty headings

    In addition, during testing with the Drupal Accessibility Team , we came up with some recommendations that @rkoller has thankfully outlined. The following steps should fix these navigation issues for users of assistive technology:

    1. Complementary renamed to:

    • administrative sidebar complementary

    2. Administrative toolbar content navigation gets replaced by:

    • shortcuts navigation (one menu item)
    • content navigation (six menu items)
    • administration navigation (seven menu items)

    3. Administrative toolbar footer navigation:

    • help navigation (one menu item)
    • user navigation (one menu item)

    So we'd end up with the following:

    Before

    • Complementary
    • Administrative toolbar content navigation
    • Administrative toolbar footer navigation

    After

    • administrative sidebar complementary
    • shortcuts navigation
    • content navigation
    • administration navigation
    • help navigation
    • user navigation

    Please find details on this proposal in this Google doc, specifically the action items section of the proposal.

  • 🇬🇧United Kingdom catch

    Moving to needs work for #50.

    2. Administrative toolbar content navigation gets replaced by:

    shortcuts navigation (one menu item)
    content navigation (six menu items)
    administration navigation (seven menu items)

    3. Administrative toolbar footer navigation:

    help navigation (one menu item)
    user navigation (one menu item)

    It looks like this could probably be achieved by moving the aria markup to the individual navigation block plugins.

  • Pipeline finished with Success
    about 1 month ago
    Total: 370s
    #477151
  • Pipeline finished with Failed
    about 1 month ago
    Total: 604s
    #477164
  • Pipeline finished with Success
    about 1 month ago
    Total: 1183s
    #477181
  • 🇷🇸Serbia finnsky

    Thanks for participating everyone!

    I added one small change by removing the useless wrapper.

    - In comment 50 I see screenshots from the old toolbar. While we need to test the new one. This may be my mistake. When I restarted Tugboat I did not enable our module in it. Sorry

    - In the attached Google doc I see sentences like

    Complementary renamed to: administrative sidebar complementary

    while I see that it is pronounced in VoiceOver as
    `Administrative sidebar, complementary` so nothing needs to be renamed?

    What is the desired level of granularity using the example of the navigational sidebar?

    We don't know. Let's choose the best option

    Other questions in the doc seem to me to be beyond the scope of the current task. At least we can definitely solve them later and not delay this last release blocker.

    So I'm moving the task to review again and asking you to do the following:

    Answer the question.
    Does the current MR satisfy the minimum accessibility requirements? And if it doesn't, what should we do to achieve them?

  • 🇬🇧United Kingdom catch

    Oh good spot in #52, that's definitely the old toolbar, completely missed that given shortcuts, user etc. also exist in the new navigation.

  • 🇩🇪Germany rkoller Nürnberg, Germany

    I’ve taken another look at the current state of the MR and created two small videos to illustrate the difference between the current state of the navigation (check 11.x.mp4) and the state in the MR (check MR.mp4)

    The point that still needs some more discussion is the level of granularity of landmarks, as outlined in the first question in the google doc by @katannshaw. In 11.x you currently have the complementary wrapping landmark and the two navigation landmarks for the content and the footer section (11.x.mp4). With the MR you now have the complementary wrapping landmark and another landmark for each of the five navigation blocks (MR.mp4) - three of those blocks even have just a single menu item.

    We have discussed the matter in the accessibility office hour end of march where we havent come to a consensus which of the variants outlined in the first question of the google doc should be picked. Back then we agreed to ask for feedback over on the accessibility slack about the preferences and expectations of screenreader users in regard to landmark regions - reason is that quite a few screenreader users are part of the community there. But unfortunately we havent received any actionable feedback yet :( In addition to that i’ve posted over in the CMS Garden Rocketchat instance and asked in their a11y channel as well.

    The worry and the reason why we tried to get feedback from actual screenreader users simply is, that the number of navigation landmarks might be way too granular - to reach the main landmark with the MR applied you have to pass by eight landmarks first (five navigation landmarks and two more complementary landmarks, both wrappers for the navigation sidebar and the topbar). The docs of the skipto script (https://skipto-landmarks-headings.github.io/page-script-5/config.html) state something in a similar vein:

    The list of landmarks and headings should be relatively short, the more items the menu contains the more time the user will need to scan and navigate to the section they want to “skip to”.

    “Strictly” speaking, landmarks should segment a page into semantically clearly distinguishable sections, so a user is able on one hand to understand the sites general structure and on the other hand is able to skip to the section in question more easily. but the five navigation blocks are semantically too close/similar, since together they build the main navigation aka navigation sidebar.

    The other minor problem i see, the complementary landmark that you get with the aside element feels semantically wrong, complementary is about supporting the main content (https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/), which might be the right choice in cases like for example https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/nav, but for something like the main navigation it feels not like the best pick?

    Personally I would lean towards a solution with two landmarks, one for the navigation sidebar and one for the navigation topbar. For the sidebar i would use a navigation landmark and label it with primary, that way it would be crystal clear that this is the main navigation for the admin ui. For the topbar the complementary landmark is fine. But that is only my personal opinion. Curious what Kat and others think about it, plus i still hope to get some feedback from actual screenreader users, those who actually use landmarks on a daily basis would be the most helpful answering this question. :/

  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • 🇬🇧United Kingdom catch

    Personally I would lean towards a solution with two landmarks, one for the navigation sidebar and one for the navigation topbar. For the sidebar i would use a navigation landmark and label it with primary, that way it would be crystal clear that this is the main navigation for the admin ui. For the topbar the complementary landmark is fine.

    From your description, this sounds sensible to me. Having to click past eight landmarks seems unreasonable. People could also add even more blocks on real sites.

    I personally think we should go ahead with that idea here, and open a follow-up to review it with more feedback for actual screen reader users. This is the last blocker to navigation being stable but it's also something that can be tweaked without BC implications once it is stable.

  • 🇬🇧United Kingdom catch
  • 🇫🇷France nod_ Lille

    +1 for the two landmarks

  • Production build 0.71.5 2024