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

Firefox122: Add clonable attribute to ShadowRoot #21948

Merged
merged 7 commits into from
Jan 24, 2024

Conversation

pepelsbey
Copy link
Member

@pepelsbey pepelsbey commented Jan 17, 2024

Summary

Added new attachShadow clonable option and ShadowRoot clonable attribute per updated DOM spec:

  • Available since Firefox Nightly 122
  • Not available in Safari (it’s complicated, see below)
  • Not available in Chrome Canary

Safari

⚠️ It is available in Safari but with a different spelling:

  • Since Safari 16.4 as an option
  • Since Safari TP 186 as an attribute

There’s a mistype in Safari’s implementation: it should be clonable per spec, not cloneable, in both cases. I made it false for now, and I will get back once it’s fixed.

WPT agrees: clonable.window.html

Test results and supporting details

How I tested support in the DevTools console:

const host = document.createElement('div');
const shadowRoot = host.attachShadow({mode: 'open', clonable: true});
shadowRoot.clonable;

Related issues

@github-actions github-actions bot added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Jan 17, 2024
@pepelsbey pepelsbey marked this pull request as ready for review January 18, 2024 09:58
@skyclouds2001
Copy link
Contributor

skyclouds2001 commented Jan 19, 2024

specific as an alternative_name, maybe

like
image

@pepelsbey
Copy link
Member Author

specific as an alternative_name, maybe

Nice idea! Still, I’d wait for them to rename it since it won’t be shipped in production.

@dipikabh dipikabh changed the title Add clonable attribute to ShadowRoot Firefox122: Add clonable attribute to ShadowRoot Jan 23, 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.

As discussed in the BCD call yesterday

api/Element.json Outdated Show resolved Hide resolved
api/ShadowRoot.json Outdated Show resolved Hide resolved
Co-authored-by: Florian Scholz <fs@florianscholz.com>
@pepelsbey
Copy link
Member Author

As discussed in the BCD call yesterday

Thanks!

@pepelsbey pepelsbey requested review from Elchi3 and removed request for queengooborg January 24, 2024 10:41
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 d322e17 into mdn:main Jan 24, 2024
6 checks passed
@pepelsbey pepelsbey deleted the shadowroot-clonable branch January 24, 2024 11:09
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants