Skip to content

Conversation

@meyerweb
Copy link
Contributor

@meyerweb meyerweb commented Dec 9, 2025

Description

Adds brief summaries of referenceTarget on attachShadow() and ShadowRoot, and shadowrootreferencetarget on <template>.

Motivation

Implemented experimentally in Chrome and positive signals from Mozilla and funding to implement in WebKit as well as progress in the HTML and WHATNOT arenas.

Additional details

@meyerweb meyerweb requested review from a team as code owners December 9, 2025 16:24
@meyerweb meyerweb requested review from estelle and wbamberg and removed request for a team December 9, 2025 16:24
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Preview URLs

Flaws (1)

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/ShadowRoot
Title: ShadowRoot
Flaw count: 1

  • macros:
    • Can't resolve /en-US/docs/Web/API/ShadowRoot/getSelection

(comment last updated: 2025-12-09 16:28:05)

The value defaults to `false`.

- `shadowrootreferencetarget` {{Experimental_Inline}}
- : Sets the value of the `referenceTarget` property of a [`ShadowRoot`](/en-US/docs/Web/API/ShadowRoot) created using this element. The value should be the ID of an element inside the shadow DOM. If set, target references to the host element from outside the shadow DOM will cause the referenced target element to become the effective target of the reference to the host element.
Copy link

Choose a reason for hiding this comment

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

The value should be the ID of an element inside the shadow DOM. If set, target references to the host element from outside the shadow DOM will cause the referenced target element to become the effective target of the reference to the host element.

I think this wording is great, how would you feel about including it for each of these brief descriptions?

- : Returns the {{DOMxRef('Element')}} set as the target for mouse events while the pointer is locked.
`null` if lock is pending, pointer is unlocked, or if the target is in another tree.
- `ShadowRoot.referenceTarget` {{ReadOnlyInline}} {{Experimental_Inline}}
- : A string value that indicates the effective target of any element reference made against the shadow host from outside the host element.
Copy link

Choose a reason for hiding this comment

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

Suggested change
- : A string value that indicates the effective target of any element reference made against the shadow host from outside the host element.
- : A string value that indicates the effective target of any element reference made against the shadow host from outside the host element. The value should be the ID of an element inside the shadow DOM. If set, target references to the host element from outside the shadow DOM will cause the referenced target element to become the effective target of the reference to the host element.

When a non-focusable part of the shadow DOM is clicked, the first focusable part is given focus, and the shadow host is given any available `:focus` styling. Its default value is `false`.

- `referenceTarget` {{Optional_Inline}} {{Experimental_Inline}}
- : A string specifying the _reference target_ of any element references made against the host element of the shadow DOM tree. The reference target must be an element held within the shadow DOM.
Copy link

Choose a reason for hiding this comment

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

Suggested change
- : A string specifying the _reference target_ of any element references made against the host element of the shadow DOM tree. The reference target must be an element held within the shadow DOM.
- : A string value that indicates the effective target of any element reference made against the shadow host from outside the host element. The value should be the ID of an element inside the shadow DOM. If set, target references to the host element from outside the shadow DOM will cause the referenced target element to become the effective target of the reference to the host element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants