Skip to content

Conversation

captainbrosset
Copy link
Contributor

Fixes #2309.

This is a pretty pivotal feature for web components, as it allows to correctly map IDREF attributes to things inside the shadow DOM, without breaking encapsulation.

It's apparently been through an origin trial in Chromium, but I'm not sure what the plans are when it comes to shipping.
@dandclark can you share any plans on the above?

It's been proposed for Interop 26: web-platform-tests/interop#1011

@github-actions github-actions bot added feature definition Creating or defining new features or groups of features. tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings labels Sep 24, 2025
@captainbrosset captainbrosset changed the title Add the referencetarget early feature Add the referencetarget feature Sep 24, 2025
@dandclark
Copy link

There are a few open issues that still need to be worked through, tracked from WICG/webcomponents#1086.

@@ -0,0 +1,8 @@
name: Reference target
description: The `referenceTarget` property of a `ShadowRoot` object forwards attributes such as `for` and `aria-labelledby` to elements inside a shadow DOM. This allows, for example, to link a `<label>` to its `<input>` even if the `<input>` is in the shadow DOM of a web component.
spec: https://github.com/WICG/webcomponents/blob/gh-pages/proposals/reference-target-explainer.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's customary to link in-progress spec PRs for features in development, but if those are allowed here then these are the best spec links for the feature for now:
whatwg/html#10995
whatwg/dom#1353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features. tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reference Target
2 participants