Implement method to remove media controls

This commit is contained in:
Fernando Jiménez Moreno 2019-05-13 14:33:55 +02:00
parent 142d42a833
commit 23def72787
3 changed files with 24 additions and 6 deletions

View file

@ -501,6 +501,15 @@ impl Element {
Ok(shadow_root)
}
pub fn detach_shadow(&self) {
if let Some(ref shadow_root) = self.shadow_root() {
self.node.owner_doc().unregister_shadow_root(shadow_root);
self.ensure_rare_data().shadow_root = None;
} else {
debug_assert!(false, "Trying to detach a non-attached shadow root");
}
}
}
#[allow(unsafe_code)]