diff options
author | Bruno de Oliveira Abinader <bruno.d@partner.samsung.com> | 2014-07-14 14:15:41 -0400 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno.d@partner.samsung.com> | 2014-07-16 08:59:56 -0400 |
commit | aea4ccf8496ec9639be666bf93918fb09edd7027 (patch) | |
tree | 77b57e677c243942e89dfce292ede62fa85be751 /src/components/script/dom/virtualmethods.rs | |
parent | e8996d5ce57c473c33b3bf5c140f7e91dd811e91 (diff) | |
download | servo-aea4ccf8496ec9639be666bf93918fb09edd7027.tar.gz servo-aea4ccf8496ec9639be666bf93918fb09edd7027.zip |
Added 'parent is/was in tree' param to bind_to_tree/unbind_from_tree
According to a talk with Ms2ger, both bind_to_tree / unbind_from_tree
should be called regardless if the tree is part of a Document. This
information is now passed as a parameter to their respective virtual
methods.
Diffstat (limited to 'src/components/script/dom/virtualmethods.rs')
-rw-r--r-- | src/components/script/dom/virtualmethods.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/script/dom/virtualmethods.rs b/src/components/script/dom/virtualmethods.rs index aa1ac0313b9..9ebb9a336c4 100644 --- a/src/components/script/dom/virtualmethods.rs +++ b/src/components/script/dom/virtualmethods.rs @@ -60,18 +60,20 @@ pub trait VirtualMethods { } } - /// Called when a Node is appended to a tree that is part of a Document. - fn bind_to_tree(&self) { + /// Called when a Node is appended to a tree, where 'tree_in_doc' indicates + /// whether the tree is part of a Document. + fn bind_to_tree(&self, tree_in_doc: bool) { match self.super_type() { - Some(ref s) => s.bind_to_tree(), + Some(ref s) => s.bind_to_tree(tree_in_doc), _ => (), } } - /// Called when a Node is removed from a tree that is part of a Document. - fn unbind_from_tree(&self) { + /// Called when a Node is removed from a tree, where 'tree_in_doc' + /// indicates whether the tree is part of a Document. + fn unbind_from_tree(&self, tree_in_doc: bool) { match self.super_type() { - Some(ref s) => s.unbind_from_tree(), + Some(ref s) => s.unbind_from_tree(tree_in_doc), _ => (), } } |