diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-05-13 14:33:55 +0200 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-07-22 17:40:15 +0200 |
commit | 23def72787bcf32e910adeac50131053d0d03e21 (patch) | |
tree | 55a37fe95591b136ba4148ed21f2c35f8fc4de73 /components/script/dom/document.rs | |
parent | 142d42a8332c1710b93fa3a79cf0485cbbf55c5b (diff) | |
download | servo-23def72787bcf32e910adeac50131053d0d03e21.tar.gz servo-23def72787bcf32e910adeac50131053d0d03e21.zip |
Implement method to remove media controls
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 7e1314f400a..50c0f8d4f4d 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -20,6 +20,7 @@ use crate::dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFram use crate::dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use crate::dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter; use crate::dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceMethods; +use crate::dom::bindings::codegen::Bindings::ShadowRootBinding::ShadowRootMethods; use crate::dom::bindings::codegen::Bindings::TouchBinding::TouchMethods; use crate::dom::bindings::codegen::Bindings::WindowBinding::{ FrameRequestCallback, ScrollBehavior, WindowMethods, @@ -2474,6 +2475,14 @@ impl Document { } pub fn unregister_media_controls(&self, id: &str) { + if let Some(media_controls) = self.media_controls.borrow().get(id) { + media_controls.Host().detach_shadow(); + media_controls + .upcast::<Node>() + .dirty(NodeDamage::OtherNodeDamage); + } else { + debug_assert!(false, "Trying to unregister unknown media controls"); + } self.media_controls.borrow_mut().remove(id); } } |