diff --git a/src/components/gfx/render_task.rs b/src/components/gfx/render_task.rs index 0ef051f1413..170c8ad6158 100644 --- a/src/components/gfx/render_task.rs +++ b/src/components/gfx/render_task.rs @@ -58,13 +58,28 @@ pub fn BufferRequest(screen_rect: Rect, page_rect: Rect) -> BufferReq } } +// FIXME(rust#9155): this should be a newtype struct, but +// generic newtypes ICE when compiled cross-crate #[deriving(Clone)] -pub struct RenderChan{chan:SharedChan>} -impl RenderChan { +pub struct RenderChan { + chan: SharedChan>, +} +impl RenderChan { pub fn new(chan: Chan>) -> RenderChan { - RenderChan{chan:SharedChan::new(chan)} + RenderChan { + chan: SharedChan::new(chan), + } + } +} +impl GenericChan> for RenderChan { + fn send(&self, msg: Msg) { + assert!(self.try_send(msg), "RenderChan.send: render port closed") + } +} +impl GenericSmartChan> for RenderChan { + fn try_send(&self, msg: Msg) -> bool { + self.chan.try_send(msg) } - pub fn send(&self, msg: Msg) { self.chan.send(msg) } } struct RenderTask { diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index 555325b80c0..fd477790193 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -438,7 +438,7 @@ impl Constellation { if pipeline.subpage_id.expect("Constellation: child frame does not have a subpage id. This should not be possible.") == subpage_id { child_frame_tree.rect = Some(rect.clone()); - let Rect { size: Size2D { width, height }, _ } = rect; + let Size2D { width, height } = rect.size; pipeline.script_chan.send(ResizeMsg(pipeline.id.clone(), Size2D { width: width as uint, height: height as uint