diff options
author | Martin Robinson <mrobinson@igalia.com> | 2014-10-29 19:02:31 -0700 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2014-11-03 10:30:28 -0800 |
commit | 2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8 (patch) | |
tree | b49ad076db1f72b40102aaaa99683775749d883f /components/script/layout_interface.rs | |
parent | 1a3ff8739c2a17d61f295f213f31ddee25e0b3ae (diff) | |
download | servo-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/layout_interface.rs')
-rw-r--r-- | components/script/layout_interface.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 735893f497a..2cf64f961fb 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -60,9 +60,9 @@ pub enum Msg { // 3) and really needs to be fast. pub trait LayoutRPC { /// Requests the dimensions of the content box, as in the `getBoundingClientRect()` call. - fn content_box(&self, node: TrustedNodeAddress) -> ContentBoxResponse; + fn content_box(&self) -> ContentBoxResponse; /// Requests the dimensions of all the content boxes, as in the `getClientRects()` call. - fn content_boxes(&self, node: TrustedNodeAddress) -> ContentBoxesResponse; + fn content_boxes(&self) -> ContentBoxesResponse; /// Requests the node containing the point of interest fn hit_test(&self, node: TrustedNodeAddress, point: Point2D<f32>) -> Result<HitTestResponse, ()>; fn mouse_over(&self, node: TrustedNodeAddress, point: Point2D<f32>) -> Result<MouseOverResponse, ()>; @@ -82,6 +82,13 @@ pub enum ReflowGoal { ReflowForScriptQuery, } +/// Any query to perform with this reflow. +pub enum ReflowQueryType { + NoQuery, + ContentBoxQuery(TrustedNodeAddress), + ContentBoxesQuery(TrustedNodeAddress), +} + /// Information needed for a reflow. pub struct Reflow { /// The document node. @@ -99,7 +106,9 @@ pub struct Reflow { /// The channel that we send a notification to. pub script_join_chan: Sender<()>, /// Unique identifier - pub id: uint + pub id: uint, + /// The type of query if any to perform during this reflow. + pub query_type: ReflowQueryType, } /// Encapsulates a channel to the layout task. |