aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-04-29 08:38:50 -0400
committerGitHub <noreply@github.com>2019-04-29 08:38:50 -0400
commit799490a02e9bea575bf34c39f045ef0883539f05 (patch)
tree278cada683564db36997cf3f96c92513b89c3096 /components/script/dom/htmlscriptelement.rs
parentd58ea974baff1b51a43d2e2bf4b287ff11991a8d (diff)
parent37e88e77cdf00e3555599dd4004d03548bd95dcf (diff)
downloadservo-799490a02e9bea575bf34c39f045ef0883539f05.tar.gz
servo-799490a02e9bea575bf34c39f045ef0883539f05.zip
Auto merge of #22743 - ferjm:shadowdom, r=emilio
Partial ShadowDOM support This is just an early WIP, not to take it very seriously yet. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [x] These changes fix #22719 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22743) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r--components/script/dom/htmlscriptelement.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 627cfc7e779..8d44c4b9ffd 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -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};
@@ -372,7 +372,7 @@ impl HTMLScriptElement {
}
// Step 5.
- if !self.upcast::<Node>().is_in_doc() {
+ if !self.upcast::<Node>().is_connected() {
return;
}
@@ -760,7 +760,7 @@ impl VirtualMethods for HTMLScriptElement {
match *attr.local_name() {
local_name!("src") => {
if let AttributeMutation::Set(_) = mutation {
- if !self.parser_inserted.get() && self.upcast::<Node>().is_in_doc() {
+ if !self.parser_inserted.get() && self.upcast::<Node>().is_connected() {
self.prepare();
}
}
@@ -773,17 +773,17 @@ impl VirtualMethods for HTMLScriptElement {
if let Some(ref s) = self.super_type() {
s.children_changed(mutation);
}
- if !self.parser_inserted.get() && self.upcast::<Node>().is_in_doc() {
+ if !self.parser_inserted.get() && self.upcast::<Node>().is_connected() {
self.prepare();
}
}
- fn bind_to_tree(&self, tree_in_doc: bool) {
+ fn bind_to_tree(&self, context: &BindContext) {
if let Some(ref s) = self.super_type() {
- s.bind_to_tree(tree_in_doc);
+ s.bind_to_tree(context);
}
- if tree_in_doc && !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();