Web-Facing Change PSA: shadowrootslotassignment attribute for declarative shadow DOM

6 views
Skip to first unread message

Chromestatus

unread,
12:17 PM (1 hour ago) 12:17 PM
to blin...@chromium.org, felip...@igalia.com
Contact emails
felip...@igalia.com

Specification
https://html.spec.whatwg.org/#attr-template-shadowrootslotassignment

Summary
Adds the shadowrootslotassignment attribute to the <template> element, allowing declarative shadow roots to use manual slot assignment. Until now this option was only available imperatively, via attachShadow({slotAssignment: "manual"}), so components that rely on manual assignment could not create their shadow roots declaratively. The attribute accepts "named" (the default, preserving current behavior) and "manual", and is reflected by the shadowRootSlotAssignment property on HTMLTemplateElement.

Blink component
Blink>DOM>ShadowDOM

Web Feature ID
declarative-shadow-dom

Risks


Interoperability and Compatibility
Low risk. The new behavior is opt-in: it only applies when a page explicitly sets shadowrootslotassignment="manual", and the default ("named") matches current behavior, so existing content is unaffected. The attribute is specified in the HTML Standard (merged via https://github.com/whatwg/html/pull/12267, originally raised in https://github.com/WICG/webcomponents/issues/967) and both Gecko and WebKit have already implemented it, so shipping in Chromium completes cross-engine support. The change is guarded by the ShadowRootSlotAssignment feature flag (enabled by default from M151), retained as a kill switch and expected to be removed around M153.

Gecko: Shipped/Shipping (https://bugzilla.mozilla.org/show_bug.cgi?id=2023824)

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=310090https://github.com/WebKit/standards-positions/issues/631

Web developers: Positive (https://github.com/WICG/webcomponents/issues/967)

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No information provided


Debuggability
No new DevTools work required. The attribute is visible in the Elements panel like the other shadowroot* attributes, and the resulting shadow root's mode is already exposed via ShadowRoot.slotAssignment.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
Yes

Is this feature fully tested by web-platform-tests?
Yes
https://wpt.fyi/results/shadow-dom/declarative/declarative-shadow-dom-repeats-slot-assignment.html https://wpt.fyi/results/shadow-dom/declarative/declarative-shadow-dom-slot-assignment.html https://wpt.fyi/results/shadow-dom/declarative/declarative-shadow-dom-slot-assignment-serialization.html



Tracking bug
https://issues.chromium.org/issues/493315747

Estimated milestones
Shipping on desktop151
Shipping on Android151
Shipping on WebView151


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5203283359694848

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages