mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix crash when closing window containing video element (#31413)
* Forbid casting DOM objects when JS runtime is shutting down. * Remove media controls from document when element is removed from the tree.
This commit is contained in:
parent
e078a99817
commit
b182bdfa52
3 changed files with 15 additions and 2 deletions
|
@ -1998,8 +1998,6 @@ impl Drop for HTMLMediaElement {
|
|||
warn!("GLPlayer disappeared!: {:?}", err);
|
||||
}
|
||||
}
|
||||
|
||||
self.remove_controls();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2454,6 +2452,8 @@ impl VirtualMethods for HTMLMediaElement {
|
|||
fn unbind_from_tree(&self, context: &UnbindContext) {
|
||||
self.super_type().unwrap().unbind_from_tree(context);
|
||||
|
||||
self.remove_controls();
|
||||
|
||||
if context.tree_connected {
|
||||
let task = MediaElementMicrotask::PauseIfNotInDocumentTask {
|
||||
elem: DomRoot::from_ref(self),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue