aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_interface.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/layout_interface.rs')
-rw-r--r--components/script/layout_interface.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs
index b94758f56b7..d94f6e4a581 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 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<f32>) -> Result<HitTestResponse, ()>;
fn mouse_over(&self, node: TrustedNodeAddress, point: Point2D<f32>) -> Result<MouseOverResponse, ()>;
@@ -102,6 +104,9 @@ pub trait LayoutRPC {
pub struct ContentBoxResponse(pub Rect<Au>);
pub struct ContentBoxesResponse(pub Vec<Rect<Au>>);
+pub struct NodeGeometryResponse {
+ pub client_rect: Rect<i32>,
+}
pub struct HitTestResponse(pub UntrustedNodeAddress);
pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>);
@@ -120,6 +125,7 @@ pub enum ReflowQueryType {
NoQuery,
ContentBoxQuery(TrustedNodeAddress),
ContentBoxesQuery(TrustedNodeAddress),
+ NodeGeometryQuery(TrustedNodeAddress),
}
/// Information needed for a reflow.