- From: Westbrook Johnson <notifications@github.com>
- Date: Thu, 15 Aug 2024 12:16:06 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/1068@github.com>
I don't think it needs to block initial testing/implementation of Reference Target, by any means, but I would like to see a conversation around non-reference attributes and whether they can be passed via this pattern. Starting specifically with accessibility attributes, it would seem that things like `role`, `aria-label`, and `aria-description`, et al deserve to be passed to the Reference Target the same way the ID reference based relations are passed. See https://github.com/w3c/aria/issues/2303 for use cases. In that way, we won't see authors asking the question of why this: ``` <label for="x-checkbox">I'm a checkbox</label> <x-checkbox id="x-checkbox"> <template shadowrootmode="open" shadowrootreferencetarget="real-input" > <input type="checkbox" id="real-input"> </template> </x-checkbox> ``` Would work differently than this: ``` <x-checkbox aria-label="I'm a checkbox"> <template shadowrootmode="open" shadowrootreferencetarget="real-input" > <input type="checkbox" id="real-input"> </template> </x-checkbox> ``` In both cases a _label_ applied outside of the shadow root is pointed to an element with a Reference Target. Both types of labels should likely behave similarly. This, of course, does beg the harrowing question of "when does it stop?". Many authors wonder how to mirror ALL attributes down into a child. In this way, an author could make a `<x-input>` and have all of the attributes be passed down to a `<input>` internal of the shadow root. Is there a way to know what attributes are unique to the target of a reference? `aria-` attributes seem like a no brainer due to the idea that you've established a Reference Target to begin with. However, could the delta of attributes on the Reference Target that are not on `HTMLElement` in some way to assumed or triggered to pass as well? This would make things like `<meter>`, which has unique attribtues like `min`, `max`, `low`, `high`, `optimum`, and `value`, much easier to customize with a custom elements: ``` <x-meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="50"> at 50/100 <template shadowrootmode="open" shadowrootreferencetarget="meter" > <styles>/* ... */</styles> <custom-stuff></custom-stuff> <meter" id="meter"><meter> </template> </x-meter> ``` -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/1068 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/1068@github.com>
Received on Thursday, 15 August 2024 19:16:10 UTC