Intent to Prototype: Shadow root clonable attribute

223 views
Skip to first unread message

Mason Freed

unread,
Jan 26, 2024, 3:53:16 PMJan 26
to blink-dev

Contact emails

mas...@chromium.org

Explainer

None

Specification

https://dom.spec.whatwg.org/#shadowroot-clonable

Summary

This enables individual control over whether a shadow root is clonable (via standard platform cloning commands such as `cloneNode()`). By default, declarative shadow roots are clonable. Imperative shadow roots can now be controlled via a parameter to `attachShadow()`.



Blink component

Blink>DOM>ShadowDOM

Motivation

None



Initial public proposal

None

Search tags

declarative shadow dom

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

This is a slight change in behavior, which poses a very small compat risk. Prior to this feature, only declarative shadow roots within `<template>` elements would get automatically cloned. With the change, any declarative shadow root, even in the main page, will get cloned. Safari already shipped the new behavior, reducing the risk. I plan to enable this functionality slowly and monitor for breakage and bug reports.



Gecko: Positive (https://bugzilla.mozilla.org/show_bug.cgi?id=1868428) Shipping soon

WebKit: Shipped/Shipping (https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes#Web-API)

Web developers: No signals

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?

None



Debuggability

None



Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/shadow-dom/declarative/clonable.window.html



Flag name on chrome://flags

ShadowRootClonable

Finch feature name

ShadowRootClonable

Requires code in //chrome?

False

Tracking bug

https://crbug.com/1510466

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5161435196030976

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