pub struct CssDependencyChain {
pub property_type: CssPropertyType,
pub steps: Vec<CssDependencyChainStep>,
pub cached_pixels: Option<f32>,
}Expand description
A dependency chain for a CSS property value. Example: [10% of node 10, then 1.2em of that, then 1.5em of that]
During layout, this chain is resolved by:
- Starting with the root dependency (e.g., node 10’s resolved font-size)
- Applying each transformation in sequence
- Producing the final pixel value
Fields§
§property_type: CssPropertyTypeThe property type this chain is for
steps: Vec<CssDependencyChainStep>The ordered list of dependencies, from root to leaf Empty if the value is absolute (no dependencies)
cached_pixels: Option<f32>Cached resolved value (in pixels) from the last resolution None if the chain hasn’t been resolved yet
Implementations§
Source§impl CssDependencyChain
impl CssDependencyChain
Sourcepub fn absolute(property_type: CssPropertyType, pixels: f32) -> Self
pub fn absolute(property_type: CssPropertyType, pixels: f32) -> Self
Create a new dependency chain for an absolute pixel value
Sourcepub fn percent(
property_type: CssPropertyType,
source_node: NodeId,
factor: f32,
) -> Self
pub fn percent( property_type: CssPropertyType, source_node: NodeId, factor: f32, ) -> Self
Create a new dependency chain for a percentage-based value
Sourcepub fn em(
property_type: CssPropertyType,
source_node: NodeId,
factor: f32,
) -> Self
pub fn em( property_type: CssPropertyType, source_node: NodeId, factor: f32, ) -> Self
Create a new dependency chain for an em-based value
Sourcepub fn rem(property_type: CssPropertyType, factor: f32) -> Self
pub fn rem(property_type: CssPropertyType, factor: f32) -> Self
Create a new dependency chain for a rem-based value
Sourcepub fn depends_on(&self, node_id: NodeId) -> bool
pub fn depends_on(&self, node_id: NodeId) -> bool
Check if this chain depends on a specific node
Trait Implementations§
Source§impl Clone for CssDependencyChain
impl Clone for CssDependencyChain
Source§fn clone(&self) -> CssDependencyChain
fn clone(&self) -> CssDependencyChain
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CssDependencyChain
impl Debug for CssDependencyChain
Source§impl PartialEq for CssDependencyChain
impl PartialEq for CssDependencyChain
impl StructuralPartialEq for CssDependencyChain
Auto Trait Implementations§
impl Freeze for CssDependencyChain
impl RefUnwindSafe for CssDependencyChain
impl Send for CssDependencyChain
impl Sync for CssDependencyChain
impl Unpin for CssDependencyChain
impl UnwindSafe for CssDependencyChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more