diff options
author | lpy <pylaurent1314@gmail.com> | 2014-04-02 01:28:44 +0800 |
---|---|---|
committer | lpy <pylaurent1314@gmail.com> | 2014-04-02 01:28:44 +0800 |
commit | d4d6fcb5f06a21091960bd809282c5eadf99caa2 (patch) | |
tree | 82479f8da40c0049da6bbb5318fb03e3b0b19b39 /src/components/script/script_task.rs | |
parent | ac5a634082fa3871a849f171e671d86efc30d074 (diff) | |
download | servo-d4d6fcb5f06a21091960bd809282c5eadf99caa2.tar.gz servo-d4d6fcb5f06a21091960bd809282c5eadf99caa2.zip |
Get rid of match statements in layout queries in script_task
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 11 |
1 files changed, 4 insertions, 7 deletions
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<Element>) { let (port, chan) = Chan::new(); let node: JS<Node> = 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. |