Intent to Ship: Shadow root clonable attribute

491 views
Skip to first unread message

Mason Freed

unread,
Feb 15, 2024, 6:12:25 PMFeb 15
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()`). Imperative shadow roots can now be controlled via a parameter to `attachShadow({clonable:true})`. Declarative shadow roots can be controlled via a new attribute, `<template shadowrootmode=open shadowrootclonable>`.



Blink component

Blink>DOM>ShadowDOM

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, declarative shadow roots within `<template>` elements would get automatically cloned. With the change, only shadow roots that are explicitly set to `clonable` will be cloned. I believe the usage of the "inside-template" behavior before was minimal, so the risk should be low. 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



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/shadow-root-clonable.html



Flag name on chrome://flags

ShadowRootClonable

Finch feature name

ShadowRootClonable

Requires code in //chrome?

False

Tracking bug

https://crbug.com/1510466

Estimated milestones

Shipping on desktop124
Shipping on Android124
Shipping on WebView124


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5161435196030976

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDiPDiSgLRpcW8Q%3DhYTrt%3Dgp%2B%2B6eiS21s_TwFEr%2BHamONA%40mail.gmail.com

This intent message was generated by Chrome Platform Status.

Mike Taylor

unread,
Feb 16, 2024, 9:30:57 AMFeb 16
to Mason Freed, blink-dev

LGTM1 to ship (see below).

On 2/15/24 6:12 PM, Mason Freed wrote:


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()`). Imperative shadow roots can now be controlled via a parameter to `attachShadow({clonable:true})`. Declarative shadow roots can be controlled via a new attribute, `<template shadowrootmode=open shadowrootclonable>`.



Blink component

Blink>DOM>ShadowDOM

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, declarative shadow roots within `<template>` elements would get automatically cloned. With the change, only shadow roots that are explicitly set to `clonable` will be cloned. I believe the usage of the "inside-template" behavior before was minimal, so the risk should be low. Safari already shipped the new behavior, reducing the risk. I plan to enable this functionality slowly and monitor for breakage and bug reports.

It looks like Safari has only shipped to Beta...

...but this has also been in Firefox Nightly and Beta, shipping to Stable in 123 (on Feb 20). Obvious breakage tends to surface in Firefox Nightly pretty quickly. Mozilla shipping 2 months before us will also allow us to get a sense of possible breakage before we hit the stable channel.

I think the risk is non-zero, but likely very, very low - so thanks for rolling this out slowly and being willing to turn it off if you discover significant issues that can't be quickly resolved via outreach.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com.

Mason Freed

unread,
Feb 16, 2024, 8:40:23 PMFeb 16
to Mike Taylor, blink-dev
On Fri, Feb 16, 2024 at 6:30 AM Mike Taylor <mike...@chromium.org> wrote:

LGTM1 to ship (see below).

Thanks!  
It looks like Safari has only shipped to Beta...

Yes, this was a recent consensus/spec, so it hasn't made it all the way to stable yet. 

...but this has also been in Firefox Nightly and Beta, shipping to Stable in 123 (on Feb 20). Obvious breakage tends to surface in Firefox Nightly pretty quickly. Mozilla shipping 2 months before us will also allow us to get a sense of possible breakage before we hit the stable channel.

Ahh, thanks for checking on this. I agree that should help. 

I think the risk is non-zero, but likely very, very low - so thanks for rolling this out slowly and being willing to turn it off if you discover significant issues that can't be quickly resolved via outreach.

Thanks! Will do.

Thanks,
Mason

Manuel Rego Casasnovas

unread,
Feb 19, 2024, 7:27:26 AMFeb 19
to Mason Freed, Mike Taylor, blink-dev
LGTM2.

On 17/02/2024 02:40, Mason Freed wrote:
> On Fri, Feb 16, 2024 at 6:30 AM Mike Taylor <mike...@chromium.org
> <mailto:mike...@chromium.org>> wrote:
>
> __
>
> LGTM1 to ship (see below).
>
> Thanks!
>
> It looks like Safari has only shipped to Beta...
>
>
> Yes, this was a recent consensus/spec, so it hasn't made it all the way
> to stable yet.
>
>>
>> /Gecko/: Positive
>> (https://bugzilla.mozilla.org/show_bug.cgi?id=1868428
>> <https://bugzilla.mozilla.org/show_bug.cgi?id=1868428>) Shipping soon
>
> ...but this has also been in Firefox Nightly and Beta, shipping to
> Stable in 123 <https://bugzilla.mozilla.org/show_bug.cgi?id=1870052>
> (on Feb 20). Obvious breakage tends to surface in Firefox Nightly
> pretty quickly. Mozilla shipping 2 months before us will also allow
> us to get a sense of possible breakage before we hit the stable channel.
>
> Ahh, thanks for checking on this. I agree that should help.
>
> I think the risk is non-zero, but likely very, very low - so thanks
> for rolling this out slowly and being willing to turn it off if you
> discover significant issues that can't be quickly resolved via outreach.
>
> Thanks! Will do.
>
> Thanks,
> Mason
>
>>
>> /WebKit/: Shipped/Shipping
>> (https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes#Web-API <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
>>
>>
>>
>> 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
>> <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md>?
>>
>> Yes
>>
>> https://wpt.fyi/results/shadow-dom/shadow-root-clonable.html
>> <https://wpt.fyi/results/shadow-dom/shadow-root-clonable.html>
>>
>>
>>
>> Flag name on chrome://flags
>>
>> ShadowRootClonable
>>
>>
>> Finch feature name
>>
>> ShadowRootClonable
>>
>>
>> Requires code in //chrome?
>>
>> False
>>
>>
>> Tracking bug
>>
>> https://crbug.com/1510466 <https://crbug.com/1510466>
>>
>>
>> Estimated milestones
>>
>> Shipping on desktop 124
>>
>> Shipping on Android 124
>>
>> Shipping on WebView 124
>>
>>
>>
>> Anticipated spec changes
>>
>> Open questions about a feature may be a source of future web
>> compat or interop issues. Please list open issues (e.g. links to
>> known github issues in the project for the feature specification)
>> whose resolution may introduce web compat/interop risk (e.g.,
>> changing to naming or structure of the API in a
>> non-backward-compatible way).
>>
>> None
>>
>>
>> Link to entry on the Chrome Platform Status
>>
>> https://chromestatus.com/feature/5161435196030976
>> <https://chromestatus.com/feature/5161435196030976>
>>
>>
>> Links to previous Intent discussions
>>
>> Intent to prototype:
>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDiPDiSgLRpcW8Q%3DhYTrt%3Dgp%2B%2B6eiS21s_TwFEr%2BHamONA%40mail.gmail.com <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDiPDiSgLRpcW8Q%3DhYTrt%3Dgp%2B%2B6eiS21s_TwFEr%2BHamONA%40mail.gmail.com>
>>
>> This intent message was generated by Chrome Platform Status
>> <https://chromestatus.com/>.
>> --
>> You received this message because you are subscribed to the Google
>> Groups "blink-dev" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to blink-dev+...@chromium.org
>> <mailto:blink-dev+...@chromium.org>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDhpEru0j03S04%2Bea0LBfFNfRvqZPaRbXS_s3dG8qVza8A%40mail.gmail.com <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDhpEru0j03S04%2Bea0LBfFNfRvqZPaRbXS_s3dG8qVza8A%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Yoav Weiss (@Shopify)

unread,
Feb 21, 2024, 1:43:47 AMFeb 21
to blink-dev, Manuel Rego, blink-dev, Mason Freed, Mike Taylor
LGTM3

>> To view this discussion on the web visit
>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send

Mason Freed

unread,
Feb 21, 2024, 6:16:20 PMFeb 21
to Yoav Weiss (@Shopify), blink-dev, Manuel Rego, Mike Taylor
Thank you all!

LGTM3

>> send an email to blink-dev+...@chromium.org
>> <mailto:blink-dev+...@chromium.org>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjeNTzKD%3DMpiPbi64%2BEq97vnAA1Q%2BfMG--iFCG8N%3DSa9Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
Reply all
Reply to author
Forward
0 new messages