mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add FrameTree::add_child
This helper method simplifies a few lines.
This commit is contained in:
parent
6a46eef5cd
commit
f1d82cf82c
1 changed files with 6 additions and 4 deletions
|
@ -118,6 +118,10 @@ impl FrameTree {
|
||||||
has_compositor_layer: Cell::new(false),
|
has_compositor_layer: Cell::new(false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn add_child(&self, new_child: ChildFrameTree) {
|
||||||
|
self.children.borrow_mut().push(new_child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
|
@ -720,8 +724,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
let new_frame_tree =
|
let new_frame_tree =
|
||||||
Rc::new(FrameTree::new(self.get_next_frame_id(), new_pipeline,
|
Rc::new(FrameTree::new(self.get_next_frame_id(), new_pipeline,
|
||||||
Some(frame_tree.pipeline.borrow().clone())));
|
Some(frame_tree.pipeline.borrow().clone())));
|
||||||
frame_tree.children.borrow_mut().push(ChildFrameTree::new(new_frame_tree,
|
frame_tree.add_child(ChildFrameTree::new(new_frame_tree, new_rect));
|
||||||
new_rect));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -963,8 +966,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
let parent = next_frame_tree.find(parent.id).expect(
|
let parent = next_frame_tree.find(parent.id).expect(
|
||||||
"Constellation: pending frame has a parent frame that is not
|
"Constellation: pending frame has a parent frame that is not
|
||||||
active. This is a bug.");
|
active. This is a bug.");
|
||||||
parent.children.borrow_mut().push(ChildFrameTree::new(to_add.clone(),
|
parent.add_child(ChildFrameTree::new(to_add.clone(), rect));
|
||||||
rect));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue