Add Instance::clone_multiple_into_external_dom

This commit is contained in:
Kenneth Loeffler 2023-10-04 13:21:08 -04:00
parent ef838815d2
commit 24fff3ffa0

View file

@ -144,6 +144,21 @@ impl Instance {
cloned
}
pub fn clone_multiple_into_external_dom(
referents: &[DomRef],
external_dom: &mut WeakDom,
) -> Vec<DomRef> {
let dom = INTERNAL_DOM.lock().expect("Failed to lock document");
let cloned = dom.clone_multiple_into_external(referents, external_dom);
for referent in cloned.iter() {
external_dom.transfer_within(*referent, external_dom.root_ref());
}
cloned
}
/**
Clones the instance and all of its descendants, and orphans it.