Re: [WICG/webcomponents] Interaction between ElementInternals (e.g. default ARIA) and declarative shadow DOM (Issue #972)

> There are a few solutions to consider here.
> 
> 1. Put ARIA on `template` element and automatically transfer them to `ElementInternals`. This is a bit strange since we'd be special-casing ARIA on template elements then.
> 2. Introduce new shadowaria* or defaultaria* content attributes. e.g. shadowarialabel="blah" or defaultarialabel="blah" would translate to setting ariaLabel to "blah" in `ElementInternals`.
> 3. "elementinternals" content attribute with its own micro-syntax for serializing `ElementInternals`. e.g. `elementinternals="role='checkbox' ariaLabel='blah'"` or `elementinternals='{"role": "checkbox", "ariaLabel": "blah"}'`.
> 4. Specify (2) or (3) on the shadow host. This will mirror `ElementInternals` being independent of shadow DOM.

I agree that this is something we should work on. In terms of a solution, <span>#</span>1 sounds the most straightforward, and the least confusing from a developer point of view. Since a `<template>` doesn't render anything anyway, I would hope extra `aria-*` attributes on something that doesn't render a box shouldn't matter. Needs confirmation. Adding tons of `shadowaria*` sounds kind of ugly, as does a new `elementinternals` attribute. Though, `elementinternals` could be helpful for other things so perhaps that's worth exploring.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/972#issuecomment-1267689861
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/972/1267689861@github.com>

Received on Tuesday, 4 October 2022 22:52:36 UTC