diff options
-rw-r--r-- | src/components/main/constellation.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index 4ffe5e3230d..b5783533da9 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -509,17 +509,12 @@ impl Constellation { // from a pending frame. The only time that we will grant paint permission is // when the message originates from a pending frame or the current frame. - for self.current_frame().iter().advance |current_frame| { + for self.current_frame().iter().advance |¤t_frame| { // Messages originating in the current frame are not navigations; // TODO(tkuehn): In fact, this kind of message might be provably // impossible to occur. if current_frame.contains(pipeline_id) { - let (port, chan) = comm::stream(); - self.compositor_chan.send(SetIds(current_frame.to_sendable(), chan)); - port.recv(); - for current_frame.iter().advance |frame| { - frame.pipeline.grant_paint_permission(); - } + self.set_ids(current_frame); return true; } } @@ -608,12 +603,7 @@ impl Constellation { // Grants a frame tree permission to paint; optionally updates navigation to reflect a new page fn grant_paint_permission(&mut self, frame_tree: @mut FrameTree) { // Give permission to paint to the new frame and all child frames - let (port, chan) = comm::stream(); - self.compositor_chan.send(SetIds(frame_tree.to_sendable(), chan)); - port.recv(); - for frame_tree.iter().advance |frame| { - frame.pipeline.grant_paint_permission(); - } + self.set_ids(frame_tree); // Don't call navigation_context.load() on a Navigate type (or None, as in the case of // parsed iframes that finish loading) @@ -633,5 +623,14 @@ impl Constellation { _ => {} } } + + fn set_ids(&self, frame_tree: @mut FrameTree) { + let (port, chan) = comm::stream(); + self.compositor_chan.send(SetIds(frame_tree.to_sendable(), chan)); + port.recv(); + for frame_tree.iter().advance |frame| { + frame.pipeline.grant_paint_permission(); + } + } } |