Skip to content

[Reference Target] Reflect host even if reference target is invalid#60283

Merged
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-cl-7883837
May 30, 2026
Merged

[Reference Target] Reflect host even if reference target is invalid#60283
chromium-wpt-export-bot merged 1 commit into
masterfrom
chromium-export-cl-7883837

Conversation

@chromium-wpt-export-bot
Copy link
Copy Markdown
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 29, 2026

Currently if a shadow root's reference target doesn't match any ID in
the shadow, any element-reflecting IDL attributes (e.g.
popoverTargetElement) referring to the shadow host will return null.
Recent thinking in [1] and the current state of the spec PR [2] is that
these should still reflect the shadow host, same as if the reference
target pointed to a matching element.

Update the Chromium implementation and tests to match this updated
behavior. As it turns out, this also slightly simplifies the
implementation.

[1] WICG/webcomponents#1114
[2] whatwg/html#10995

Bug: 346835896
Change-Id: Ic321d5dffc1800fc081e9edfbb46524acc63a8be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7883837
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1638691}

Currently if a shadow root's reference target doesn't match any ID in
the shadow, any element-reflecting IDL attributes (e.g.
popoverTargetElement) referring to the shadow host will return null.
Recent thinking in [1] and the current state of the spec PR [2] is that
these should still reflect the shadow host, same as if the reference
target pointed to a matching element.

Update the Chromium implementation and tests to match this updated
behavior. As it turns out, this also slightly simplifies the
implementation.

[1] WICG/webcomponents#1114
[2] whatwg/html#10995

Bug: 346835896
Change-Id: Ic321d5dffc1800fc081e9edfbb46524acc63a8be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7883837
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1638691}
Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 25d70ee into master May 30, 2026
27 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7883837 branch May 30, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants