mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Implement offsetParent/Top/Left/Width/Height.
This commit is contained in:
parent
1809748dc1
commit
9e5687e3e7
21 changed files with 325 additions and 24 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue