Skip to content

Commit

Permalink
Add ShadowRoot clonable attribute
Browse files Browse the repository at this point in the history
Depends on D193677

Differential Revision: https://phabricator.services.mozilla.com/D195577

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1868428
gecko-commit: ade0be35500e4779e48c750433cdd6129471b049
gecko-reviewers: avandolder, webidl, emilio
  • Loading branch information
saschanaz authored and moz-wptsync-bot committed Dec 12, 2023
1 parent dffd060 commit dbd04c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions shadow-dom/declarative/clonable.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test(() => {
const div = document.createElement("div");
const root = div.attachShadow({ mode: "open", clonable: true });
root.appendChild(document.createElement("input"));
assert_true(root.clonable, "clonable attribute");

const cloned = div.cloneNode(true);
assert_equals(cloned.shadowRoot.children.length, 1, "children count");
assert_equals(cloned.shadowRoot.children[0].localName, "input", "children content");
}, "attachShadow with clonable: true");

0 comments on commit dbd04c7

Please sign in to comment.