diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index af1d70444a2..a70d6798431 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -140,11 +140,8 @@ impl HTMLImageElement { let page = window.get().page(); let (port, chan) = Chan::new(); let addr = node.to_trusted_node_address(); - match page.query_layout(ContentBoxQuery(addr, chan), port) { - ContentBoxResponse(rect) => { - to_px(rect.size.width) as u32 - } - } + let ContentBoxResponse(rect) = page.query_layout(ContentBoxQuery(addr, chan), port); + to_px(rect.size.width) as u32 } pub fn SetWidth(&mut self, abstract_self: &JS, width: u32) -> ErrorResult { @@ -159,11 +156,8 @@ impl HTMLImageElement { let (port, chan) = Chan::new(); let this_node: JS = NodeCast::from(abstract_self); let addr = this_node.to_trusted_node_address(); - match page.query_layout(ContentBoxQuery(addr, chan), port) { - ContentBoxResponse(rect) => { - to_px(rect.size.height) as u32 - } - } + let ContentBoxResponse(rect) = page.query_layout(ContentBoxQuery(addr, chan), port); + to_px(rect.size.height) as u32 } pub fn SetHeight(&mut self, abstract_self: &JS, height: u32) -> ErrorResult { diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 22a03a7b680..2fba7693687 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -929,13 +929,10 @@ impl ScriptTask { fn scroll_fragment_point(&self, pipeline_id: PipelineId, page: &Page, node: JS) { let (port, chan) = Chan::new(); let node: JS = NodeCast::from(&node); - match page.query_layout(ContentBoxQuery(node.to_trusted_node_address(), chan), port) { - ContentBoxResponse(rect) => { - let point = Point2D(to_frac_px(rect.origin.x).to_f32().unwrap(), - to_frac_px(rect.origin.y).to_f32().unwrap()); - self.compositor.scroll_fragment_point(pipeline_id, point); - } - } + let ContentBoxResponse(rect) = page.query_layout(ContentBoxQuery(node.to_trusted_node_address(), chan), port); + let point = Point2D(to_frac_px(rect.origin.x).to_f32().unwrap(), + to_frac_px(rect.origin.y).to_f32().unwrap()); + self.compositor.scroll_fragment_point(pipeline_id, point); } /// This is the main entry point for receiving and dispatching DOM events.