diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-02-13 08:50:28 +0530 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-04-10 10:27:32 +0200 |
commit | 6388dec9966679202904f2f59d8efe8df7edb9c8 (patch) | |
tree | 24a6f5a242d043bb557d5972b77515cba3c90148 /src/components/script/dom/virtualmethods.rs | |
parent | f5d1907195500aa6785b3c6034058e5d2b66dae7 (diff) | |
download | servo-6388dec9966679202904f2f59d8efe8df7edb9c8.tar.gz servo-6388dec9966679202904f2f59d8efe8df7edb9c8.zip |
Add overridable tree binding/unbinding behaviour.
Diffstat (limited to 'src/components/script/dom/virtualmethods.rs')
-rw-r--r-- | src/components/script/dom/virtualmethods.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/script/dom/virtualmethods.rs b/src/components/script/dom/virtualmethods.rs index f189f0443e8..866ace84e02 100644 --- a/src/components/script/dom/virtualmethods.rs +++ b/src/components/script/dom/virtualmethods.rs @@ -42,6 +42,22 @@ pub trait VirtualMethods { _ => (), } } + + /// Called when a Node is appended to a tree that is part of a Document. + fn bind_to_tree(&mut self) { + match self.super_type() { + Some(ref mut s) => s.bind_to_tree(), + _ => (), + } + } + + /// Called when a Node is removed from a tree that is part of a Document. + fn unbind_from_tree(&mut self) { + match self.super_type() { + Some(ref mut s) => s.unbind_from_tree(), + _ => (), + } + } } /// Obtain a VirtualMethods instance for a given Node-derived object. Any |