pub struct ResolvedBoxProps {
pub margin: EdgeSizes,
pub padding: EdgeSizes,
pub border: EdgeSizes,
pub margin_auto: MarginAuto,
}Expand description
A fully resolved representation of a node’s box model properties.
All values are in pixels. This is the result of resolving UnresolvedBoxProps
against a containing block.
Fields§
§margin: EdgeSizes§padding: EdgeSizes§border: EdgeSizes§margin_auto: MarginAutoTracks which margins are set to auto.
CSS 2.2 § 10.3.3: If both margin-left and margin-right are auto,
their used values are equal, centering the element within its container.
Implementations§
Source§impl ResolvedBoxProps
impl ResolvedBoxProps
Sourcepub fn inner_size(
&self,
outer_size: LogicalSize,
wm: LayoutWritingMode,
) -> LogicalSize
pub fn inner_size( &self, outer_size: LogicalSize, wm: LayoutWritingMode, ) -> LogicalSize
Calculates the inner content-box size from an outer border-box size, correctly accounting for the specified writing mode.
Sourcepub fn content_box(&self, border_box: LogicalRect) -> LogicalRect
pub fn content_box(&self, border_box: LogicalRect) -> LogicalRect
Returns the content-box rect from a border-box rect. Shrinks inward by border + padding on each side.
Sourcepub fn padding_box(&self, border_box: LogicalRect) -> LogicalRect
pub fn padding_box(&self, border_box: LogicalRect) -> LogicalRect
Returns the padding-box rect from a border-box rect. Shrinks inward by border on each side.
Sourcepub fn margin_box(&self, border_box: LogicalRect) -> LogicalRect
pub fn margin_box(&self, border_box: LogicalRect) -> LogicalRect
Returns the margin-box rect from a border-box rect. Expands outward by margin on each side.
Sourcepub fn horizontal_mbp(&self) -> f32
pub fn horizontal_mbp(&self) -> f32
Total horizontal space consumed by margin + border + padding.
Sourcepub fn vertical_mbp(&self) -> f32
pub fn vertical_mbp(&self) -> f32
Total vertical space consumed by margin + border + padding.
Sourcepub fn horizontal_bp(&self) -> f32
pub fn horizontal_bp(&self) -> f32
Total horizontal space consumed by border + padding only (no margin).
Sourcepub fn vertical_bp(&self) -> f32
pub fn vertical_bp(&self) -> f32
Total vertical space consumed by border + padding only (no margin).
Trait Implementations§
Source§impl Clone for ResolvedBoxProps
impl Clone for ResolvedBoxProps
Source§fn clone(&self) -> ResolvedBoxProps
fn clone(&self) -> ResolvedBoxProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedBoxProps
impl Debug for ResolvedBoxProps
Source§impl Default for ResolvedBoxProps
impl Default for ResolvedBoxProps
Source§fn default() -> ResolvedBoxProps
fn default() -> ResolvedBoxProps
impl Copy for ResolvedBoxProps
Auto Trait Implementations§
impl Freeze for ResolvedBoxProps
impl RefUnwindSafe for ResolvedBoxProps
impl Send for ResolvedBoxProps
impl Sync for ResolvedBoxProps
impl Unpin for ResolvedBoxProps
impl UnsafeUnpin for ResolvedBoxProps
impl UnwindSafe for ResolvedBoxProps
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
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>
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>
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