-
Notifications
You must be signed in to change notification settings - Fork 187
Add the referencetarget feature #3376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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 |
There was a problem hiding this comment.
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
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | |
description: The `referenceTarget` property of a `ShadowRoot` object forwards attributes such as `for` and `aria-labelledby` to elements inside a shadow DOM. You can use this to, for example, link a `<label>` to its `<input>` even if the `<input>` is in the shadow DOM of a web component. |
# No BCD keys yet as the feature hasn't shipped anywhere. | ||
# It's being implemented in Chromium, and has gone through an origin trial in 133-135: | ||
# https://chromestatus.com/feature/5188237101891584 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In lieu of "no BCD" comments, I think it would be nice if we started listing predicted BCD keys. So in this case, something like:
# No BCD keys yet as the feature hasn't shipped anywhere. | |
# It's being implemented in Chromium, and has gone through an origin trial in 133-135: | |
# https://chromestatus.com/feature/5188237101891584 | |
# Expected keys via Chrome origin trial in 133-135 https://chromestatus.com/feature/5188237101891584 | |
# api.Element.attachShadow.options_referenceTarget_parameter |
and so on
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