aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2014-10-29 19:02:31 -0700
committerMartin Robinson <mrobinson@igalia.com>2014-11-03 10:30:28 -0800
commit2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8 (patch)
treeb49ad076db1f72b40102aaaa99683775749d883f /components/script/dom/node.rs
parent1a3ff8739c2a17d61f295f213f31ddee25e0b3ae (diff)
downloadservo-2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8.tar.gz
servo-2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8.zip
Have ContentBox(es)Queries consult the flow tree
Instead of looking at the display tree, have ContentBox(es)Query consult the flow tree. This allow optimizing away parts of the display tree later. To do this we need to be more careful about how we send reflow requests, only querying the flow tree when possible. Fixes #3790.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index af1afccc3b1..54bda6acc03 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -45,8 +45,7 @@ use dom::text::Text;
use dom::virtualmethods::{VirtualMethods, vtable_for};
use dom::window::Window;
use geom::rect::Rect;
-use layout_interface::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC,
- LayoutChan, ReapLayoutDataMsg};
+use layout_interface::{LayoutChan, ReapLayoutDataMsg};
use devtools_traits::NodeInfo;
use script_traits::UntrustedNodeAddress;
use servo_util::geometry::Au;
@@ -689,20 +688,11 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
}
fn get_bounding_content_box(self) -> Rect<Au> {
- let window = window_from_node(self).root();
- let page = window.page();
- let addr = self.to_trusted_node_address();
-
- let ContentBoxResponse(rect) = page.layout().content_box(addr);
- rect
+ window_from_node(self).root().page().content_box_query(self.to_trusted_node_address())
}
fn get_content_boxes(self) -> Vec<Rect<Au>> {
- let window = window_from_node(self).root();
- let page = window.page();
- let addr = self.to_trusted_node_address();
- let ContentBoxesResponse(rects) = page.layout().content_boxes(addr);
- rects
+ window_from_node(self).root().page().content_boxes_query(self.to_trusted_node_address())
}
// http://dom.spec.whatwg.org/#dom-parentnode-queryselector