Shadow role — referenceTarget labelling
Each component sets shadowRoot.referenceTarget = 'role' so
that aria-labelledby and aria-describedby attributes on
the host element resolve directly to the inner shadow element with
id="role". No LabellingController, no
ariaLabelledByElements JS wiring — the browser handles
cross-root IDREF resolution natively.
Compare with the
hybrid demo, which achieves the same result
today using ariaLabelledByElements and the
LabellingController.
⚠️ referenceTarget is flag-gated in all browsers — click to see how to enable it
Chrome / Edge 133+
- Open
chrome://flags - Search for Experimental Web Platform Features
- Set to Enabled
- Click Relaunch
Firefox 144+
- Open
about:config - Search for
dom.shadowdom.referenceTarget.enabled - Set to true
- Restart Firefox
Safari 26+
- Open Safari → Develop menu
- Select Feature Flags…
- Find and enable referenceTarget
- Reload the page
Textfield
We’ll never share your email.
Note: <label for="tf"> click-to-focus does not work —
referenceTarget resolves IDREF attributes but does not wire the
for / labels association. A future label
behavior would close this gap.
Checkbox
Subscribe to newsletterYou can unsubscribe at any time.
Progress bar
Upload progressUploading your files to the server.
Combobox
Favorite fruitArrow keys navigate, Enter or Space selects.
referenceTarget resolves external aria-labelledby
to the inner combobox trigger. The active option (a light DOM element
referenced from a shadow element) still requires
ariaActiveDescendantElement — that cross-root direction
is not addressed by referenceTarget.