Skip to content
Permalink
Browse files

Fix "a serious bug" in the `bind_to_tree` functions

  • Loading branch information
notriddle committed Dec 6, 2016
1 parent 479a2c1 commit f8121ae60d691397d4173af2ac39fcf736bc84dd
Showing with 9 additions and 3 deletions.
  1. +4 −1 components/script/dom/htmlheadelement.rs
  2. +5 −2 components/script/dom/htmltitleelement.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);
}
}
@@ -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();
}
}

0 comments on commit f8121ae

Please sign in to comment.
You can’t perform that action at this time.