diff options
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r-- | src/components/script/dom/node.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index f9ac7b42dbc..0a7512c7b7f 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -394,6 +394,7 @@ impl<'self, View> AbstractNode<View> { } } + // Issue #1030: should not walk the tree pub fn is_in_doc(&self) -> bool { do self.with_base |node| { do node.owner_doc.with_base |document| { @@ -408,6 +409,7 @@ impl<'self, View> AbstractNode<View> { node = parent; }, None => { + // Issue #1029: this is horrible. in_doc = unsafe { node.raw_object() as uint == root.raw_object() as uint }; break; } @@ -465,13 +467,6 @@ impl Node<ScriptView> { } } - pub fn remove_from_doc(&self) { - // Signal the document that it needs to update its display. - do self.owner_doc.with_base |doc| { - doc.content_changed(); - } - } - pub fn new(type_id: NodeTypeId, doc: AbstractDocument) -> Node<ScriptView> { Node { reflector_: Reflector::new(), @@ -722,7 +717,10 @@ impl Node<ScriptView> { self.wait_until_safe_to_modify_dom(); abstract_self.remove_child(node); - self.remove_from_doc(); + // Signal the document that it needs to update its display. + do self.owner_doc.with_base |document| { + document.content_changed(); + } Ok(node) } |