ShadowRoot: clonable プロパティ
clonable
は ShadowRoot
インターフェイスの読み取り専用プロパティで、シャドウルートが複製可能であれば true
を返し、そうでなければ false
を返します。
値が true
の場合、Node.cloneNode()
または Document.importNode()
で複製されたシャドウホストにはシャドウルートのコピーが含まれます。
既定値は false
です。
true
に設定するには、Element.attachShadow()
メソッドの clonable
オプションを使用するか、またはシャドウルートを宣言的に関連付ける使用される <template>
要素の shadowrootclonable
属性を設定します。
値
シャドウルートが複製可能であれば true
、そうでなければ false
です。
例
js
const host = document.createElement("div");
const shadowRoot = host.attachShadow({
mode: "open",
clonable: true,
});
shadowRoot.clonable;
// true
仕様書
Specification |
---|
DOM # dom-shadowroot-clonable |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
clonable |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.