Skip to content

Commit

Permalink
Fix "a serious bug" in the bind_to_tree functions
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Dec 6, 2016
1 parent 479a2c1 commit f8121ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion components/script/dom/htmlheadelement.rs
Expand Up @@ -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);
}
}
7 changes: 5 additions & 2 deletions components/script/dom/htmltitleelement.rs
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit f8121ae

Please sign in to comment.