Struct layout_2020::IndefiniteContainingBlock
source · pub(crate) struct IndefiniteContainingBlock<'a> {
pub size: LogicalVec2<AuOrAuto>,
pub style: &'a ComputedValues,
}
Expand description
A containing block useful for calculating inline content sizes, which may have inline sizes that depend on block sizes due to aspect ratio.
Fields§
§size: LogicalVec2<AuOrAuto>
§style: &'a ComputedValues
Implementations§
source§impl<'a> IndefiniteContainingBlock<'a>
impl<'a> IndefiniteContainingBlock<'a>
pub(crate) fn new_for_style(style: &'a ComputedValues) -> Self
sourcepub(crate) fn new_for_style_and_block_size(
style: &'a ComputedValues,
block_size: AuOrAuto,
) -> Self
pub(crate) fn new_for_style_and_block_size( style: &'a ComputedValues, block_size: AuOrAuto, ) -> Self
Creates an IndefiniteContainingBlock
with the provided style and block size,
and the inline size is set to auto.
This is useful when finding the min-content or max-content size of an element,
since then we ignore its ‘inline-size’, ‘min-inline-size’ and ‘max-inline-size’.
pub(crate) fn new_for_intrinsic_inline_size_of_child( &self, style: &'a ComputedValues, auto_minimum: &LogicalVec2<Au>, ) -> Self
Trait Implementations§
source§impl<'a> From<&ContainingBlock<'a>> for IndefiniteContainingBlock<'a>
impl<'a> From<&ContainingBlock<'a>> for IndefiniteContainingBlock<'a>
source§fn from(containing_block: &ContainingBlock<'a>) -> Self
fn from(containing_block: &ContainingBlock<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> From<&DefiniteContainingBlock<'a>> for IndefiniteContainingBlock<'a>
impl<'a> From<&DefiniteContainingBlock<'a>> for IndefiniteContainingBlock<'a>
source§fn from(containing_block: &DefiniteContainingBlock<'a>) -> Self
fn from(containing_block: &DefiniteContainingBlock<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> TryFrom<&IndefiniteContainingBlock<'a>> for ContainingBlock<'a>
impl<'a> TryFrom<&IndefiniteContainingBlock<'a>> for ContainingBlock<'a>
Auto Trait Implementations§
impl<'a> Freeze for IndefiniteContainingBlock<'a>
impl<'a> !RefUnwindSafe for IndefiniteContainingBlock<'a>
impl<'a> Send for IndefiniteContainingBlock<'a>
impl<'a> Sync for IndefiniteContainingBlock<'a>
impl<'a> Unpin for IndefiniteContainingBlock<'a>
impl<'a> !UnwindSafe for IndefiniteContainingBlock<'a>
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert