Closed (works as designed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
Stable theme
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Jan 2019 at 13:19 UTC
Updated:
2 Dec 2025 at 19:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
corn696Comment #5
dwwClassy does the same thing. Expanding scope of title and patch to address both.
I think not fixing classy and stable during #2878115: Make the HTML wrapper tag for media items more semantically correct was an intentional choice, since stable and classy templates aren't supposed to change for BC reasons. However, as an accessibility bug, #2878115 perhaps should have gotten an exception for this.
Also marking this related to #2881745: Wrapping embedded entities in <article> is bad for accessibility, use <div> instead where this fix was made to entity_embed module as a 'Critical bug' for accessibility.
Tagging for 'needs frontend framework manager review' to get an opinion from the core frontend framework manager.
Comment #7
andrewmacpherson commentedThis isn't a serious issue for accessibility.
If #2881745: Wrapping embedded entities in <article> is bad for accessibility, use <div> instead was marked critical on the basis of accessibility, that's way off the mark. It's based on comment #2 there:
This is misleading in several ways:
<article>and<section>are very different in their ARIA mappings.<section>is treated as a landmark region, but only if it has a computed accessible name viaaria-labeloraria-labelledby.<article>is never a landmark region, regardless of whether it has a computed accessible name. Some accessibility checkers (notably SiteImprove) erroneously identifyarticleas a landmark region, and complain if it doesn't have an accessible name, but this is incorrect. The HTML accessibility API mappings do not treat it as a landmark region, and nor does any assistive tech AFAIK.<article>to have a heading, per HTML 5.2. It isn't mandatory for any other sectioning content either, and it makes no difference anyway because the section outline algorithm hasn't been implemented by any browsers.articlerole to have an accessible name, per ARIA 1.0 and ARIA 1.1. The WAI-ARIA Authoring Practices recommend it, for situations where it helps distinguish articles from one another. This isn't necessary for our use of media entities in my view. Note that we aren't using computed accessible names on node entity<article>wrappers either (though I think it would be a good idea there).Both HTML and ARIA recs explicitly permit nested articles:
The only place where I think the use of
<article>is at odds with the W3C recs is this:For most uses of media entities, this is unlikely to be the case. However this "general rule" isn't binding, and the HTML rec doesn't use MUST/SHOULD terms here. It might count as a failure of WCAG "Info and relationships", but I think it would be a rather pedantic interpretation of that success criterion.
The current usage by Drupal media is conforming to the HTML 5.2, ARIA 1.0, and ARIA 1.1 recs.
That's all theory though. How about in practice? To date, the use of
<article>makes little difference. Most assistive tech doesn't do anything special with it.articleat all, per ARIA.The use of nested article wrappers could potentially be confusing, if it's not clear that it's nested. However this isn't any different to the situation with nested landmark regions, or nested lists, in normal "browse" reading mode.
It would be nice to avoid unnecessary semantic wrappers, but it's not particularly urgent or severe in this case, and it certainly doesn't have a big impact on accessibility in practice. We're planning to remove Classy in D9, and Stable will be reset (I'm behind on those issues, so correct me if I'm wrong).
Comment #8
dww@andrewmacpherson - as usual, thanks for the incredibly detailed and useful explanation! I almost always learn a ton from your comments.
Whereas:
a) This isn't actually an accessibility bug per #7.
b) Changing classy/stable would be a BC break + disruption for existing sites.
c) Classy is being removed in #3050378: [meta] Replace Classy with a starterkit theme and stable is being reset in #3050374: Create Drupal 9 stable theme
Therefore be it resolved that this works as designed. ;)
Thanks,
-Derek
Comment #9
liam morlandFollow-up issue: #3432727: Excess use of article HTML-tag for media