Struct layout_2013::model::IntrinsicISizesContribution
source · pub struct IntrinsicISizesContribution {
pub content_intrinsic_sizes: IntrinsicISizes,
pub surrounding_size: Au,
}
Expand description
The temporary result of the computation of intrinsic inline-sizes.
Fields§
§content_intrinsic_sizes: IntrinsicISizes
Intrinsic sizes for the content only (not counting borders, padding, or margins).
surrounding_size: Au
The inline size of borders and padding, as well as margins if appropriate.
Implementations§
source§impl IntrinsicISizesContribution
impl IntrinsicISizesContribution
sourcepub fn new() -> IntrinsicISizesContribution
pub fn new() -> IntrinsicISizesContribution
Creates and initializes an inline size computation with all sizes set to zero.
sourcepub fn finish(self) -> IntrinsicISizes
pub fn finish(self) -> IntrinsicISizes
Adds the content intrinsic sizes and the surrounding size together to yield the final intrinsic size computation.
sourcepub fn union_inline(&mut self, sizes: &IntrinsicISizes)
pub fn union_inline(&mut self, sizes: &IntrinsicISizes)
Updates the computation so that the minimum is the maximum of the current minimum and the given minimum and the preferred is the sum of the current preferred and the given preferred. This is used when laying out fragments in the inline direction.
FIXME(pcwalton): This is incorrect when the inline fragment contains forced line breaks
(e.g. <br>
or white-space: pre
).
sourcepub fn union_nonbreaking_inline(&mut self, sizes: &IntrinsicISizes)
pub fn union_nonbreaking_inline(&mut self, sizes: &IntrinsicISizes)
Updates the computation so that the minimum is the sum of the current minimum and the
given minimum and the preferred is the sum of the current preferred and the given
preferred. This is used when laying out fragments in the inline direction when
white-space
is pre
or nowrap
.
sourcepub fn union_block(&mut self, sizes: &IntrinsicISizes)
pub fn union_block(&mut self, sizes: &IntrinsicISizes)
Updates the computation so that the minimum is the maximum of the current minimum and the
given minimum and the preferred is the maximum of the current preferred and the given
preferred. This can be useful when laying out fragments in the block direction (but note
that it does not take floats into account, so BlockFlow
does not use it).
This is used when contributing the intrinsic sizes for individual fragments.
Trait Implementations§
source§impl Debug for IntrinsicISizesContribution
impl Debug for IntrinsicISizesContribution
Auto Trait Implementations§
impl Freeze for IntrinsicISizesContribution
impl RefUnwindSafe for IntrinsicISizesContribution
impl Send for IntrinsicISizesContribution
impl Sync for IntrinsicISizesContribution
impl Unpin for IntrinsicISizesContribution
impl UnwindSafe for IntrinsicISizesContribution
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> 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>
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 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>
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.