Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shadowrootclonable attribute #22768

Merged
merged 3 commits into from
Apr 8, 2024
Merged

Conversation

pepelsbey
Copy link
Contributor

Summary

Adds

  • shadowrootclonable attribute
  • shadowRootClonable IDL attribute

for template element.

Test results and supporting details

Currently supported only in Chrome Canary, expected to ship in Chrome 124.

Quick test
<p>outer</p>
<div>
    <template shadowrootmode="open" shadowrootclonable>
        <p>inner</p>
    </template>
</div>
<script>
    const div = document.querySelector('div');
    const clone = div.cloneNode();
    document.body.appendChild(clone);
</script>
cloned

See Chrome Status

@github-actions github-actions bot added data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:html 📄 Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML labels Apr 4, 2024
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

Confirmed with https://mdn-bcd-collector.gooborg.com/tests/api/HTMLTemplateElement/shadowRootClonable in Chrome 124 beta, so we might as well put 124 here.

api/HTMLTemplateElement.json Outdated Show resolved Hide resolved
html/elements/template.json Outdated Show resolved Hide resolved
Co-authored-by: Florian Scholz <fs@florianscholz.com>
@pepelsbey pepelsbey requested a review from Elchi3 April 8, 2024 12:26
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@Elchi3 Elchi3 merged commit 398d316 into mdn:main Apr 8, 2024
6 checks passed
@pepelsbey pepelsbey deleted the shadowrootclonable branch April 9, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:html 📄 Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants