javascript - Cloning a ShadowRoot -
i'm trying clone shadow root, may swap instances of <content></content>
corresponding distributed nodes.
my approach:
var shadowhost = document.createelement('div'); var shadowroot = shadowhost.createshadowroot(); var clonedshadowroot = shadowroot.clonenode(true);
does not work, "shadowroot nodes not clonable.
"
the motivation wish retrieve composed shadow tree, may use rendered html markup.
edit: on second thought, may not work due nature of shadow dom, reference distributed nodes broken cloning process.
composing shadow tree native feature, having searched through w3c spec, unable find such method.
is there such native method? or, failing that, manual traversal (replicating tree in process), work?
Comments
Post a Comment