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

@ -82,8 +82,8 @@ impl VirtualMethods for HTMLSourceElement {
}
/// <https://html.spec.whatwg.org/multipage/#the-source-element:nodes-are-inserted>
fn bind_to_tree(&self, tree_in_doc: bool) {
self.super_type().unwrap().bind_to_tree(tree_in_doc);
fn bind_to_tree(&self, tree_connected: bool) {
self.super_type().unwrap().bind_to_tree(tree_connected);
let parent = self.upcast::<Node>().GetParentNode().unwrap();
if let Some(media) = parent.downcast::<HTMLMediaElement>() {
media.handle_source_child_insertion();