aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/node.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2013-10-09 16:58:18 +0200
committerMs2ger <ms2ger@gmail.com>2013-10-10 10:57:38 +0200
commit40106841f8341698dcd4082ff6d9ac205430c18d (patch)
treece4fd4fb4ca77cfeac7e3052ecfb1fc67cef26c9 /src/components/script/dom/node.rs
parent04319fdb684e37bcb29cad7e096da2298dc027a5 (diff)
downloadservo-40106841f8341698dcd4082ff6d9ac205430c18d.tar.gz
servo-40106841f8341698dcd4082ff6d9ac205430c18d.zip
Address review comment and add fixmes.
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r--src/components/script/dom/node.rs14
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)
}