mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Introduce BindContext with in_doc and connected flags
Fix some is_in_doc -> is_connected mistakes
This commit is contained in:
parent
740aae06ba
commit
813b242419
21 changed files with 105 additions and 84 deletions
|
@ -15,7 +15,7 @@ use crate::dom::element::AttributeMutation;
|
|||
use crate::dom::htmlelement::HTMLElement;
|
||||
use crate::dom::htmlimageelement::HTMLImageElement;
|
||||
use crate::dom::htmlmediaelement::HTMLMediaElement;
|
||||
use crate::dom::node::{Node, UnbindContext};
|
||||
use crate::dom::node::{BindContext, Node, UnbindContext};
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
|
@ -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_connected: bool) {
|
||||
self.super_type().unwrap().bind_to_tree(tree_connected);
|
||||
fn bind_to_tree(&self, context: &BindContext) {
|
||||
self.super_type().unwrap().bind_to_tree(context);
|
||||
let parent = self.upcast::<Node>().GetParentNode().unwrap();
|
||||
if let Some(media) = parent.downcast::<HTMLMediaElement>() {
|
||||
media.handle_source_child_insertion();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue