Open sg667 opened 7 months ago
I see header/footer tags in the core views-view.html.twig template file, too -- or maybe I'm looking at something different from what you're looking at? https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/views/templates/views-view.html.twig?ref_type=heads
(To be fair, we don't use view headers/footers super often -- or, more accurately, I don't use them or see them used super often. Could you add an example link showing where we're using headers/footers and the resulting markup is problematic?)
I added an example to a multidev https://dev-roald-hoffmann.pantheonsite.io/books/Other%20Books
It's not only adding the <header>
tag, but it's also injecting aria-labels which appear to be static values. I also must have been checking the wrong source when I was checking core files, because the file I saw had <div>
tags in place of the <header>
and <footer>
tags which is probably more appropriate overall.
I guess it could be resolved with overrides on our end when needed given it's a part of Drupal core on a case-by-case basis but given our use cases, I think it would make more sense to default to <header>
and <footer>
having no semantic role.
With that in mind, if we want to ensure compatibility if we opt to fix this, I would suggest stripping the aria-label and setting role="none"
or role="presentation"
to it.
On lines 52-56 and 78-82 of views-view.html.twig, the header and footer of a view has a
<header>
and<footer>
tag appended. This should be removed and reverted to a<div>
tag (or base Drupal markup). This is injecting a lot of misleading landmarks in code.