mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Address review comment and add fixmes.
This commit is contained in:
parent
04319fdb68
commit
40106841f8
1 changed files with 6 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue