From 162ecd0aac1ce8cd924b4f7853f7bfe6ca015348 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Sun, 19 Jul 2015 15:04:50 +0200 Subject: Implement client{Top, Left, Height, Width} element properties --- components/script/layout_interface.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'components/script/layout_interface.rs') diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 3c26f062214..60270a80c4b 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -95,6 +95,8 @@ pub trait LayoutRPC { fn content_box(&self) -> ContentBoxResponse; /// Requests the dimensions of all the content boxes, as in the `getClientRects()` call. fn content_boxes(&self) -> ContentBoxesResponse; + /// Requests the clientTop. + fn node_geometry(&self) -> NodeGeometryResponse; /// Requests the node containing the point of interest fn hit_test(&self, node: TrustedNodeAddress, point: Point2D) -> Result; fn mouse_over(&self, node: TrustedNodeAddress, point: Point2D) -> Result; @@ -102,6 +104,9 @@ pub trait LayoutRPC { pub struct ContentBoxResponse(pub Rect); pub struct ContentBoxesResponse(pub Vec>); +pub struct NodeGeometryResponse { + pub client_rect: Rect, +} pub struct HitTestResponse(pub UntrustedNodeAddress); pub struct MouseOverResponse(pub Vec); @@ -120,6 +125,7 @@ pub enum ReflowQueryType { NoQuery, ContentBoxQuery(TrustedNodeAddress), ContentBoxesQuery(TrustedNodeAddress), + NodeGeometryQuery(TrustedNodeAddress), } /// Information needed for a reflow. -- cgit v1.2.3 From 126938a963e79e5dc50ad748bb590df3c9bfdd35 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Tue, 21 Jul 2015 22:56:26 +0200 Subject: Address review comments --- components/script/layout_interface.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/script/layout_interface.rs') diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 60270a80c4b..1d5cdba2827 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -95,7 +95,7 @@ pub trait LayoutRPC { fn content_box(&self) -> ContentBoxResponse; /// Requests the dimensions of all the content boxes, as in the `getClientRects()` call. fn content_boxes(&self) -> ContentBoxesResponse; - /// Requests the clientTop. + /// Requests the geometry of this node. Used by APIs such as `clientTop`. fn node_geometry(&self) -> NodeGeometryResponse; /// Requests the node containing the point of interest fn hit_test(&self, node: TrustedNodeAddress, point: Point2D) -> Result; -- cgit v1.2.3