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.
This commit is contained in:
Bruno de Oliveira Abinader 2014-07-14 14:15:41 -04:00
parent e8996d5ce5
commit aea4ccf849
5 changed files with 32 additions and 25 deletions

View file

@ -176,12 +176,14 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> {
}
}
fn bind_to_tree(&self) {
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),
_ => (),
}
if !tree_in_doc { return; }
match self.get_url() {
Some(url) => {
let sandboxed = if self.is_sandboxed() {