{"id":1594,"date":"2025-06-07T15:57:40","date_gmt":"2025-06-07T15:57:40","guid":{"rendered":"https:\/\/html5accessibility.com\/stuff\/?p=1594"},"modified":"2025-06-08T19:02:18","modified_gmt":"2025-06-08T19:02:18","slug":"aria-html-relationship-severence","status":"publish","type":"post","link":"https:\/\/html5accessibility.com\/stuff\/2025\/06\/07\/aria-html-relationship-severence\/","title":{"rendered":"ARIA\/HTML relationship Severance"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1599\" src=\"https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_4417-Copy-1.jpg\" alt=\"Black and white photo of a scene from severence, showing camera's and other production artefacts, with the main character in a hallway on the severed level in mid stride. behid him stands Jonny James, they are back to back about 5 feet part. Jonny has his head turned to his right, he has a knowing look on his face.\" width=\"600\" height=\"396\" srcset=\"https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_4417-Copy-1.jpg 600w, https:\/\/html5accessibility.com\/stuff\/wp-content\/uploads\/2025\/06\/IMG_4417-Copy-1-300x198.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Note:<\/strong> I tried to find the orginal of this photo so I could attribute it to its creator, but came up with nothing, maybe Jonny knows&#8230;<\/p>\n<h2>Old gold<\/h2>\n<p>Back in 2014 I did some testing on <a href=\"https:\/\/www.tpgi.com\/stuff-doesnt-work-dom-shadow-dom\/\">Some stuff that doesn\u2019t work between the DOM and Shadow DOM<\/a> I was recently asked by my friend\/colleague <a href=\"https:\/\/www.linkedin.com\/in\/demelza-feltham-76bb9594\/\">Demelza Feltham<\/a> about use of <code>aria-labelledby<\/code> that referenced an element in the Shadow DOM<\/p>\n<p>What I found back then was that <code>aria<\/code> relationship attributes didn&#8217;t work when an element being referenced was outside the shadow DOM and the element referencing it was inside the shadow DOM, ditto for the opposite. It was same story for native HTML relationships as well. Fast forward to 11 years later, as in now! <strong>2025<\/strong>, and the <strong>situation remains the same<\/strong>.<\/p>\n<p>I don&#8217;t plan to go into the details of why it doesn&#8217;t work yet here, but I can assure it&#8217;s not for lack of trying on the part of <em>Standardista&#8217;s<\/em> and and Browser engineers. If you want to read more about the reasons why and why it still has not been resolved, the following are illuminating:<\/p>\n<ul>\n<li><a href=\"https:\/\/alice.pages.igalia.com\/blog\/how-shadow-dom-and-accessibility-are-in-conflict\/\">How Shadow DOM and accessibility are in conflict<\/a>\u00a0 by Alice Boxhall,\u00a0 who also provides some workarounds in their article.<\/li>\n<li><a href=\"https:\/\/nolanlawson.com\/2022\/11\/28\/shadow-dom-and-accessibility-the-trouble-with-aria\/\">Shadow DOM and accessibility: the trouble with ARIA<\/a> by Nolan Lawson (no relationship to Bruce Lawson)<\/li>\n<\/ul>\n<p>The attributes potentially affected by this issue are:<\/p>\n<h2>ARIA<\/h2>\n<p><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#attrs_relationships\">Relationship attributes<\/a>:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-activedescendant\"><code>aria-activedescendant<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-colcount\"><code>aria-colcount<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-colindex\"><code>aria-colindex<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-colspan\"><code>aria-colspan<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-controls\"><code>aria-controls<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-describedby\"><code>aria-describedby<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-details\"><code>aria-details<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-errormessage\"><code>aria-errormessage<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-flowto\"><code>aria-flowto<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-labelledby\"><code>aria-labelledby<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-owns\"><code>aria-owns<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-posinset\"><code>aria-posinset<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-rowcount\"><code>aria-rowcount<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-rowindex\"><code>aria-rowindex<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-rowspan\"><code>aria-rowspan<\/code><\/a><\/li>\n<li><a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/states_and_properties#aria-setsize\"><code>aria-setsize<\/code><\/a><\/li>\n<\/ul>\n<h2>HTML<\/h2>\n<p>Some relationship attributes<\/p>\n<ul>\n<li><code>for<\/code> attribute on <a href=\"https:\/\/stevefaulkner.github.io\/AT-browser-tests\/test-files\/label.html\"><code>label<\/code><\/a> element<\/li>\n<li><code>for<\/code> attribute on <a href=\"https:\/\/stevefaulkner.github.io\/AT-browser-tests\/test-files\/output.html\"><code>output<\/code><\/a>\u00a0\u00a0element<\/li>\n<li><code>headers<\/code> attribute on <a href=\"https:\/\/stevefaulkner.github.io\/AT-browser-tests\/test-files\/tables-complex.html\"><code>th<\/code><\/a> element<\/li>\n<li><code>&lt;a href=\"#IDinShadows\"&gt;<\/code><\/li>\n<\/ul>\n<h2>What you can do?<\/h2>\n<p>You could use standard <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/form-elements.html\">HTML controls<\/a> without all that <em>stinking<\/em> DOM darkness and encapsulation <em>fandango<\/em> fucking up your relationships.<\/p>\n<p class=\"note\"><strong>Defy the JavaScript <em>industrial complex<\/em> by any means necessary<\/strong><\/p>\n<p>If this is not an option, then there are some ways you can work around these issues in <em>some<\/em> cases. A relatively simple example is provided:<\/p>\n<p>Example with an <code>output<\/code> element outside the Shadow DOM and an <code>input type=\"range\"<\/code> element inside, the <code>output<\/code> updates with the current <code>range<\/code> value:<\/p>\n<ul>\n<li>When the user slides the <code>range input<\/code>, an <code>input event<\/code> is triggered.<\/li>\n<li>The handler sets the outer <code>&lt;output&gt;<\/code> element\u2019s <code>.value<\/code> to match the <code>range<\/code> value.<\/li>\n<li>This manually mimics what <code>&lt;output for=\"...\"&gt;<\/code> (via JavaScript) would have been done automatically if both were in the same DOM context:<\/li>\n<\/ul>\n<pre> \/\/ Update output value when range input changes\r\nshadowRange.addEventListener('input', () =&gt; {\r\noutput.value = shadowRange.value;\r\n});<\/pre>\n<p class=\"codepen\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\" data-height=\"300\" data-default-tab=\"result\" data-slug-hash=\"XJbaxXJ\" data-pen-title=\"Untitled\" data-user=\"stevef\">See the Pen <a href=\"https:\/\/codepen.io\/stevef\/pen\/XJbaxXJ\"><br \/>\nUntitled<\/a> by steve faulkner (<a href=\"https:\/\/codepen.io\/stevef\">@stevef<\/a>)<br \/>\non <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<blockquote><p><strong><em>Because something is happening here but you don&#8217;t know what it is<\/em><\/strong><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/we37yX3zpKA?si=WsDECBaES9BJgmgE\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<details>\n<summary>Lyrics<\/summary>\n<pre>You walk into the room with your pencil in your hand\r\nYou see somebody naked and you say, \"Who is that man?\"\r\nYou try so hard but you don't understand\r\nJust what you will say when you get home\r\nBecause something is happening here but you don't know what it is\r\nDo you, Mr. Jones?\r\nYou raise up your head and you ask, \"Is this where it is?\"\r\nAnd somebody points to you and says, \"It's his\"\r\nAnd you say, \"What's mine?\" and somebody else says, \"Well, what is?\"\r\nAnd you say, \"Oh my God, am I here all alone?\"\r\nBut something is happening and you don't know what it is\r\nDo you, Mr. Jones?\r\nYou hand in your ticket and you go watch the geek\r\nWho immediately walks up to you when he hears you speak\r\nAnd says, \"How does it feel to be such a freak?\"\r\nAnd you say, \"Impossible!\" as he hands you a bone\r\nAnd something is happening here but you don't know what it is\r\nDo you, Mr. Jones?\r\nYou have many contacts among the lumberjacks\r\nTo get you facts when someone attacks your imagination\r\nBut nobody has any respect, anyway they already expect you to all give a check\r\nTo tax-deductible charity organizations\r\nAh, you've been with the professors and they've all liked your looks\r\nWith great lawyers you have discussed lepers and crooks\r\nYou've been through all of F. Scott Fitzgerald's books\r\nYou're very well-read, it's well-known\r\nBut something is happening here and you don't know what it is\r\nDo you, Mr. Jones?\r\nWell, the sword swallower, he comes up to you and then he kneels\r\nHe crosses himself and then he clicks his high heels\r\nAnd without further notice, he asks you how it feels\r\nAnd he says, \"Here is your throat back, thanks for the loan\"\r\nAnd you know something is happening but you don't know what it is\r\nDo you, Mr. Jones?\r\nNow, you see this one-eyed midget shouting the word \"Now\"\r\nAnd you say, \"For what reason?\" and he says, \"How\"\r\nAnd you say, \"What does this mean?\" and he screams back, \"You're a cow!\r\nGive me some milk or else go home\"\r\nAnd you know something's happening but you don't know what it is\r\nDo you, Mr. Jones?\r\nWell, you walk into the room like a camel, and then you frown\r\nYou put your eyes in your pocket and your nose on the ground\r\nThere ought to be a law against you comin' around\r\nYou should be made to wear earphones\r\n'Cause something is happening and you don't know what it is\r\nDo you, Mr. Jones?\r\n\r\n\r\n\r\n<\/pre>\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>Note: I tried to find the orginal of this photo so I could attribute it to its creator, but came up with nothing, maybe Jonny knows&#8230; Old gold Back in 2014 I did some testing on Some stuff that doesn\u2019t work between the DOM and Shadow DOM I was recently asked by my friend\/colleague Demelza [&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-1594","post","type-post","status-publish","format-standard","hentry","category-htmlaccessibility"],"_links":{"self":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/1594","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=1594"}],"version-history":[{"count":18,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/1594\/revisions"}],"predecessor-version":[{"id":1615,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/posts\/1594\/revisions\/1615"}],"wp:attachment":[{"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/media?parent=1594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/categories?post=1594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5accessibility.com\/stuff\/wp-json\/wp\/v2\/tags?post=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}