mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
fix how FrameTrees are copied
This commit is contained in:
parent
97a60f35e3
commit
00658b2ad0
1 changed files with 15 additions and 2 deletions
|
@ -43,12 +43,25 @@ pub struct Constellation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stores the Id of the outermost frame's pipeline, along with a vector of children frames
|
/// Stores the Id of the outermost frame's pipeline, along with a vector of children frames
|
||||||
#[deriving(Clone)]
|
|
||||||
struct FrameTree {
|
struct FrameTree {
|
||||||
pipeline: @mut Pipeline,
|
pipeline: @mut Pipeline,
|
||||||
parent: Option<@mut Pipeline>,
|
parent: Option<@mut Pipeline>,
|
||||||
children: ~[@mut FrameTree],
|
children: ~[@mut FrameTree],
|
||||||
}
|
}
|
||||||
|
// Need to clone the FrameTrees, but _not_ the Pipelines
|
||||||
|
impl Clone for FrameTree {
|
||||||
|
fn clone(&self) -> FrameTree {
|
||||||
|
let mut children = ~[];
|
||||||
|
for self.children.iter().advance |&frame_tree| {
|
||||||
|
children.push(@mut (*frame_tree).clone());
|
||||||
|
}
|
||||||
|
FrameTree {
|
||||||
|
pipeline: self.pipeline,
|
||||||
|
parent: self.parent.clone(),
|
||||||
|
children: children,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct SendableFrameTree {
|
pub struct SendableFrameTree {
|
||||||
pipeline: Pipeline,
|
pipeline: Pipeline,
|
||||||
|
@ -562,7 +575,7 @@ impl Constellation {
|
||||||
// Create the next frame tree that will be given to the compositor
|
// Create the next frame tree that will be given to the compositor
|
||||||
let next_frame_tree = match to_add.parent {
|
let next_frame_tree = match to_add.parent {
|
||||||
None => to_add, // to_add is the root
|
None => to_add, // to_add is the root
|
||||||
Some(_parent) => self.current_frame().get_ref().clone(),
|
Some(_parent) => @mut (*self.current_frame().get()).clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// If there are frames to revoke permission from, do so now.
|
// If there are frames to revoke permission from, do so now.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue