Add is_connected flag to node and use it to replace most uses of is_in_doc

This commit is contained in:
Fernando Jiménez Moreno 2019-01-27 17:11:11 +01:00
parent 640fc04743
commit 441357b74e
29 changed files with 111 additions and 96 deletions

View file

@ -2009,7 +2009,7 @@ impl VirtualMethods for HTMLMediaElement {
fn unbind_from_tree(&self, context: &UnbindContext) {
self.super_type().unwrap().unbind_from_tree(context);
if context.tree_in_doc {
if context.tree_connected {
let task = MediaElementMicrotask::PauseIfNotInDocumentTask {
elem: DomRoot::from_ref(self),
};
@ -2061,7 +2061,7 @@ impl MicrotaskRunnable for MediaElementMicrotask {
}
},
&MediaElementMicrotask::PauseIfNotInDocumentTask { ref elem } => {
if !elem.upcast::<Node>().is_in_doc() {
if !elem.upcast::<Node>().is_connected() {
elem.internal_pause_steps();
}
},