diff options
author | Michael Howell <michael@notriddle.com> | 2016-12-06 00:42:29 +0000 |
---|---|---|
committer | Michael Howell <michael@notriddle.com> | 2016-12-06 00:42:29 +0000 |
commit | f8121ae60d691397d4173af2ac39fcf736bc84dd (patch) | |
tree | 4b4dffdaa0c7bbfc17a6f6435dbee1dbec3acfd3 /components/script | |
parent | 479a2c12177bd7b031705b5ca66ab8b246059cd9 (diff) | |
download | servo-f8121ae60d691397d4173af2ac39fcf736bc84dd.tar.gz servo-f8121ae60d691397d4173af2ac39fcf736bc84dd.zip |
Fix "a serious bug" in the `bind_to_tree` functions
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/htmlheadelement.rs | 5 | ||||
-rw-r--r-- | components/script/dom/htmltitleelement.rs | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs index 419644c5bb3..fc6e888d015 100644 --- a/components/script/dom/htmlheadelement.rs +++ b/components/script/dom/htmlheadelement.rs @@ -71,7 +71,10 @@ impl VirtualMethods for HTMLHeadElement { fn super_type(&self) -> Option<&VirtualMethods> { Some(self.upcast::<HTMLElement>() as &VirtualMethods) } - fn bind_to_tree(&self, _tree_in_doc: bool) { + fn bind_to_tree(&self, tree_in_doc: bool) { + if let Some(ref s) = self.super_type() { + s.bind_to_tree(tree_in_doc); + } load_script(self); } } diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs index c124a4a3604..f3ec357cb56 100644 --- a/components/script/dom/htmltitleelement.rs +++ b/components/script/dom/htmltitleelement.rs @@ -71,9 +71,12 @@ impl VirtualMethods for HTMLTitleElement { } } - fn bind_to_tree(&self, is_in_doc: bool) { + fn bind_to_tree(&self, tree_in_doc: bool) { + if let Some(ref s) = self.super_type() { + s.bind_to_tree(tree_in_doc); + } let node = self.upcast::<Node>(); - if is_in_doc { + if tree_in_doc { node.owner_doc().title_changed(); } } |