mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +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
|
@ -22,7 +22,7 @@ use crate::dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
|
|||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::htmlelement::HTMLElement;
|
||||
use crate::dom::node::{document_from_node, window_from_node};
|
||||
use crate::dom::node::{ChildrenMutation, CloneChildrenFlag, Node};
|
||||
use crate::dom::node::{BindContext, ChildrenMutation, CloneChildrenFlag, Node};
|
||||
use crate::dom::performanceresourcetiming::InitiatorType;
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use crate::network_listener::{self, NetworkListener, PreInvoke, ResourceTimingListener};
|
||||
|
@ -778,12 +778,12 @@ impl VirtualMethods for HTMLScriptElement {
|
|||
}
|
||||
}
|
||||
|
||||
fn bind_to_tree(&self, is_connected: bool) {
|
||||
fn bind_to_tree(&self, context: &BindContext) {
|
||||
if let Some(ref s) = self.super_type() {
|
||||
s.bind_to_tree(is_connected);
|
||||
s.bind_to_tree(context);
|
||||
}
|
||||
|
||||
if is_connected && !self.parser_inserted.get() {
|
||||
if context.tree_connected && !self.parser_inserted.get() {
|
||||
let script = Trusted::new(self);
|
||||
document_from_node(self).add_delayed_task(task!(ScriptDelayedInitialize: move || {
|
||||
script.root().prepare();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue