WebAIM - Web Accessibility In Mind

E-mail List Archives

for

From: Laura Fathauer
Date: Aug 4, 2025 1:29PM


I'm not surprised that you see differences in the way Voiceover/Safari's
accessibility tree handles cases like this vs how Chrome's accessibility
tree is read by Jaws and NVDA. Looking at Safari's accessibility info for
the example, it does show the enclosed heading element is "ignored: Yes
(default)".

The coding change to get better consistency across all screen
reader/browser combinations would be to move the H3 outside of the button
element, or remove the aria-label from the button.

Note that the WAI-ARIA spec indicates that button elements have a
characteristic "Children Presentational: True
<https://www.w3.org/TR/wai-aria/#tree_exclusion>", and its recommendation
is that enclosed elements "should not" be exposed in the accessibility tree
(with some exclusions).

Laura


On Mon, Aug 4, 2025 at 10:14 AM Steve Green via WebAIM-Forum <
<EMAIL REMOVED> > wrote:

> Thanks, Christine. What you are saying is true of HTML4 and XHTML 1.x, but
> HTML5 allows heading elements to be children of links. As you say, it's
> much more flexible, to the point of allowing almost any element to contain
> almost any other element.
>
> The whole rationale for dropping SC 4.1.1 was that there is now a
> specification that tells browsers how to create the DOM when elements are
> nested incorrectly, but they are not nested incorrectly in this case.
> Given that this specification exists and browsers should apply it when the
> HTML5 doctype is specified, it is all the stranger that JAWS and NVDA
> behave differently from VoiceOver.
>
> Steve
>