mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Simplify add_or_replace_pipeline_in_frame_tree.
This commit is contained in:
parent
2aa257f603
commit
d4e75e6165
1 changed files with 8 additions and 10 deletions
|
@ -1886,18 +1886,16 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
// Remove paint permissions for the pipeline being replaced.
|
||||
self.revoke_paint_permission(old_pipeline_id);
|
||||
|
||||
// Add new pipeline to navigation frame, and return frames evicted from history.
|
||||
self.pipelines
|
||||
.get(&old_pipeline_id)
|
||||
.and_then(|pipeline| pipeline.frame)
|
||||
.map(|frame_id| {
|
||||
self.pipelines.get_mut(&frame_change.new_pipeline_id)
|
||||
.map(|pipeline| pipeline.frame = Some(frame_id));
|
||||
self.frames.get_mut(&frame_id).map(|frame| frame.load(frame_change.new_pipeline_id));
|
||||
frame_id
|
||||
})
|
||||
self.pipelines.get(&old_pipeline_id).and_then(|pipeline| pipeline.frame)
|
||||
});
|
||||
|
||||
if let Some(frame_id) = frame_id {
|
||||
// Add new pipeline to navigation frame, and return frames evicted from history.
|
||||
self.pipelines.get_mut(&frame_change.new_pipeline_id)
|
||||
.map(|pipeline| pipeline.frame = Some(frame_id));
|
||||
self.frames.get_mut(&frame_id).map(|frame| frame.load(frame_change.new_pipeline_id));
|
||||
}
|
||||
|
||||
if let None = frame_id {
|
||||
// The new pipeline is in a new frame with no history
|
||||
let frame_id = self.new_frame(frame_change.new_pipeline_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue