{"id":1623,"date":"2025-06-12T16:27:10","date_gmt":"2025-06-12T16:27:10","guid":{"rendered":"https:\/\/html5accessibility.com\/stuff\/?p=1623"},"modified":"2025-06-13T08:12:16","modified_gmt":"2025-06-13T08:12:16","slug":"accname-unclarified","status":"publish","type":"post","link":"https:\/\/html5accessibility.com\/stuff\/2025\/06\/12\/accname-unclarified\/","title":{"rendered":"accname unclarified"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1625\" src=\"https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-1024x567.jpg\" alt=\"legs ending with a bulbosity just above the knee, modelling a pair of AJJY (Jonny james) socks.\" width=\"580\" height=\"321\" srcset=\"https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-1024x567.jpg 1024w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-300x166.jpg 300w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-768x425.jpg 768w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-1536x851.jpg 1536w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-2048x1134.jpg 2048w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-1200x665.jpg 1200w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_5280-1980x1096.jpg 1980w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<h2>so so intro<\/h2>\n<p>It is unclear to web developers, browser developers and assistive tech developers when an accessible name provided via <code>aria-label\/aria-labelledby<\/code> should replace the child content as the accessible name or be announced in addition to subtree content. This results in bugs and frustration for anyone that this issue touches.<\/p>\n<p>Taking the <a href=\"https:\/\/www.w3.org\/TR\/html-aria\/\">ARIA in HTML<\/a> specification, <a href=\"https:\/\/www.w3.org\/TR\/html-aria\/#allowed-descendants-of-aria-roles\">Allowed descendents of ARIA roles<\/a> as a starting place, which defines what are allowed descendents in terms of the HTML content model, I have some suggestions.<\/p>\n<p>It should be noted at this point that I haven&#8217;t looked exhaustively for discussions on this subject and they may well be underway. The motivation for this article was a <a href=\"https:\/\/github.com\/FreedomScientific\/standards-support\/issues\/909\">JAWS bug<\/a> and a <a href=\"https:\/\/aus.social\/@jcsteh\/114664529117603747\">post by Jamie Teh<\/a> on Mastodon<\/p>\n<blockquote><p>This is the age old question about whether a label should override content. That absolutely makes sense for buttons, links, etc., but it&#8217;s never been quite as clear for containers like paragraphs, table cells, etc. where there can be some nasty consequences if the label completely overrides the content.<\/p><\/blockquote>\n<h2>half arsed suggestion<\/h2>\n<p>Any role that is <strong>allowed to contain<\/strong> the listed content types as descendents may have the accessible name provided via <code>aria-label\/aria-labelledby<\/code> (if allowed to be named), but <strong>not mask the content it contains<\/strong>:<\/p>\n<ul>\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#flow-content-2\" data-link-type=\"dfn\">Flow content<\/a><\/li>\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#sectioning-content-2\" data-link-type=\"dfn\">Sectioning content<\/a><\/li>\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#interactive-content-2\" data-link-type=\"dfn\">Interactive content<\/a><\/li>\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#palpable-content-2\" data-link-type=\"dfn\">Palpable content<\/a><\/li>\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#phrasing-content-2\" data-link-type=\"dfn\">Phrasing content<\/a><\/li>\n<\/ul>\n<p>Any content defined as <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#phrasing-content-2\">Phrasing content<\/a> may have the accessible name provided via <code>aria-label\/aria-labelledby<\/code> (if allowed to be named) and <code>will mask its child content<\/code>.<\/p>\n<h2>Example<\/h2>\n<p>In the\u00a0 code example the <code>&lt;nav&gt;<\/code> element is named <code>aria-labelledby<\/code> the reference the heading element and the <code>&lt;ul&gt;<\/code> it contains is named using an <code>aria-label<\/code> In both cases as these elements are defined as allowing <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dom.html#flow-content-2\">flow content<\/a> as expected the accessible name is announced when a screen reader user navigates to the content, the user can then naviagte through the child content.<\/p>\n<pre>&lt;h1 id=\"CM\"&gt;HTML Content Models&lt;\/h1&gt;\r\n\r\n&lt;nav aria-labelledby=\"CM\"&gt;\r\n&lt;ul aria-label=\"some content models\"&gt;\r\n&lt;li&gt;&lt;a href=\"#flow-content-2\"&gt;Flow content&lt;\/a&gt;\r\n&lt;li&gt;&lt;a href=\"#sectioning-content-2\"&gt;Sectioning content&lt;\/a&gt;\r\n&lt;li&gt;&lt;a href=\"#interactive-content-2\"&gt;Interactive content&lt;\/a&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/nav&gt;<\/pre>\n<p class=\"note\">The above <strong>suggestions<\/strong> are not <em>fullproof<\/em> and there may be some <em>carve outs<\/em> required, but everything has to start somewhere&#8230;<\/p>\n<h2>listen<\/h2>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/ytQhL0-3FtM?si=PT-J6IYKaP1SCtKm\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<details>\n<summary>Lyrics<\/summary>\n<pre>This wrinkle in time, I can't give it no credit\r\nI thought about my space and I really got me down\r\n(got me down)\r\nGot me so down, I got me a headache\r\nMy heart is crammed in my cranium and it still knows how to pound\r\nI was counting the rings\r\nAnd I fell me into sleep\r\nI peeked to see if you were way back when\r\nI was counting the trees\r\nUntil a day when there was one\r\nI'd hoped beneath, asleep is where that you had been\r\nThis wrinkle in time, I can't give it no credit\r\nI thought about my space and I really got me down\r\n(got me down)\r\nGot me so down, I got me a headache\r\nMy heart is crammed in my cranium and it still knows how to pound\r\nWell, I found you\r\nMaybe you can help me\r\nAnd I can help you\r\nThis wrinkle in time, I can't give it no credit\r\nI thought about my space and I really got me down\r\n(got me down)\r\nGot me so down, I got me a headache\r\nMy heart is crammed in my cranium and it still knows how to pound\r\nGot me so down, I got me a headache\r\nMy heart is crammed in my cranium and it still knows how to pound\r\nThis wrinkle in time, I can't give it no credit\r\nI thought about my space and I really got me down\r\n(got me down)<\/pre>\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>so so intro It is unclear to web developers, browser developers and assistive tech developers when an accessible name provided via aria-label\/aria-labelledby should replace the child content as the accessible name or be announced in addition to subtree content. This results in bugs and frustration for anyone that this issue touches. Taking the ARIA in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1623","post","type-post","status-publish","format-standard","hentry","category-htmlaccessibility"],"_links":{"self":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/1623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/comments?post=1623"}],"version-history":[{"count":11,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/1623\/revisions"}],"predecessor-version":[{"id":1635,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/1623\/revisions\/1635"}],"wp:attachment":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/media?parent=1623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/categories?post=1623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/tags?post=1623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}