diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2015-07-27 15:20:27 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-08-03 11:55:38 +1000 |
commit | 9e5687e3e72f2c79bf17bcfb33ea33f0659377ac (patch) | |
tree | 747b19a3de028cebc1dca77f6edd1a38fba1cf33 /components/script/layout_interface.rs | |
parent | 1809748dc12ec63e3179b66109c91983f744c235 (diff) | |
download | servo-9e5687e3e72f2c79bf17bcfb33ea33f0659377ac.tar.gz servo-9e5687e3e72f2c79bf17bcfb33ea33f0659377ac.zip |
Implement offsetParent/Top/Left/Width/Height.
Diffstat (limited to 'components/script/layout_interface.rs')
-rw-r--r-- | components/script/layout_interface.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 8fcb298880c..a6fb9ad8491 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -104,6 +104,7 @@ pub trait LayoutRPC { fn mouse_over(&self, node: TrustedNodeAddress, point: Point2D<f32>) -> Result<MouseOverResponse, ()>; /// Query layout for the resolved value of a given CSS property fn resolved_style(&self) -> ResolvedStyleResponse; + fn offset_parent(&self) -> OffsetParentResponse; } @@ -116,6 +117,21 @@ pub struct HitTestResponse(pub UntrustedNodeAddress); pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>); pub struct ResolvedStyleResponse(pub Option<String>); +#[derive(Clone)] +pub struct OffsetParentResponse { + pub node_address: Option<UntrustedNodeAddress>, + pub rect: Rect<Au>, +} + +impl OffsetParentResponse { + pub fn empty() -> OffsetParentResponse { + OffsetParentResponse { + node_address: None, + rect: Rect::zero(), + } + } +} + /// Why we're doing reflow. #[derive(PartialEq, Copy, Clone, Debug)] pub enum ReflowGoal { @@ -133,6 +149,7 @@ pub enum ReflowQueryType { ContentBoxesQuery(TrustedNodeAddress), NodeGeometryQuery(TrustedNodeAddress), ResolvedStyleQuery(TrustedNodeAddress, Option<PseudoElement>, Atom), + OffsetParentQuery(TrustedNodeAddress), } /// Information needed for a reflow. |