diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-04-23 02:33:37 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2014-04-24 14:36:43 +0900 |
commit | dce92dc44a2f548dcf2558a47cfc47d8e7f774c3 (patch) | |
tree | 65ab26220f25bbf4c284b4bfa420dfea964c7f3a /src/components/script/script_task.rs | |
parent | 5e27f49fe2b7fb31d0635455b491c088a2b19ccf (diff) | |
download | servo-dce92dc44a2f548dcf2558a47cfc47d8e7f774c3.tar.gz servo-dce92dc44a2f548dcf2558a47cfc47d8e7f774c3.zip |
Add NodeHelpers::get_bounding_content_box().
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 a78108c057a..f608a648518 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -22,7 +22,6 @@ use html::hubbub_html_parser::HtmlParserResult; use html::hubbub_html_parser::{HtmlDiscoveredStyle, HtmlDiscoveredIFrame, HtmlDiscoveredScript}; use html::hubbub_html_parser; use layout_interface::{AddStylesheetMsg, DocumentDamage}; -use layout_interface::{ContentBoxQuery, ContentBoxResponse}; use layout_interface::{DocumentDamageLevel, HitTestQuery, HitTestResponse, LayoutQuery, MouseOverQuery, MouseOverResponse}; use layout_interface::{LayoutChan, MatchSelectorsDocumentDamage, QueryMsg}; use layout_interface::{Reflow, ReflowDocumentDamage, ReflowForDisplay, ReflowGoal, ReflowMsg}; @@ -958,11 +957,9 @@ impl ScriptTask { chan.send(LoadCompleteMsg(page.id, url)); } - fn scroll_fragment_point(&self, pipeline_id: PipelineId, page: &Page, node: JS<Element>) { - let (chan, port) = channel(); + fn scroll_fragment_point(&self, pipeline_id: PipelineId, node: JS<Element>) { let node: JS<Node> = NodeCast::from(&node); - let ContentBoxResponse(rect) = - page.query_layout(ContentBoxQuery(node.to_trusted_node_address(), chan), port); + let rect = node.get_bounding_content_box(); let point = Point2D(to_frac_px(rect.origin.x).to_f32().unwrap(), to_frac_px(rect.origin.y).to_f32().unwrap()); // FIXME(#2003, pcwalton): This is pretty bogus when multiple layers are involved. @@ -1000,7 +997,7 @@ impl ScriptTask { let mut fragment_node = page.fragment_node.deref().borrow_mut(); match fragment_node.take() { - Some(node) => self.scroll_fragment_point(pipeline_id, page, node), + Some(node) => self.scroll_fragment_point(pipeline_id, node), None => {} } @@ -1159,7 +1156,7 @@ impl ScriptTask { if click_frag { match page.find_fragment_node(url.fragment.unwrap()) { - Some(node) => self.scroll_fragment_point(page.id, page, node), + Some(node) => self.scroll_fragment_point(page.id, node), None => {} } } else { |