This is an alternative implementation, not the markup in !17968: the same messages in a section with an accessible name. A named section is exposed as a region landmark without an explicit ARIA role.
What to notice
- A
sectionis not a landmark on its own. It becomes aregionbecause it has an accessible name. aria-label="System messages"names it. A visible heading plusaria-labelledbywould work too, but would change the visual appearance.- The accessibility tree is the same as the After page: one region named “System messages”, with the three live groups inside.
- This is the HTML-first option. !17968 keeps a
divwithrole="region"because the templates already emit adiv; changing the element would be a larger theme change. - The
data-drupal-messagesattribute is Drupal’s JavaScript hook. The section here omits it; a theme using this approach would still need a hook for JavaScript messages.
Back to the overview, or compare with server and JavaScript messages.