Struct layout_2020::positioned::AbsoluteAxisSolver
source · struct AbsoluteAxisSolver<'a> {
containing_size: Au,
padding_border_sum: Au,
computed_margin_start: AuOrAuto,
computed_margin_end: AuOrAuto,
computed_sizes: Sizes,
avoid_negative_margin_start: bool,
box_offsets: AbsoluteBoxOffsets<'a>,
static_position_rect_axis: RectAxis,
alignment: AlignFlags,
flip_anchor: bool,
}
Fields§
§containing_size: Au
§padding_border_sum: Au
§computed_margin_start: AuOrAuto
§computed_margin_end: AuOrAuto
§computed_sizes: Sizes
§avoid_negative_margin_start: bool
§box_offsets: AbsoluteBoxOffsets<'a>
§static_position_rect_axis: RectAxis
§alignment: AlignFlags
§flip_anchor: bool
Implementations§
source§impl<'a> AbsoluteAxisSolver<'a>
impl<'a> AbsoluteAxisSolver<'a>
sourcefn inset_sum(&self) -> Au
fn inset_sum(&self) -> Au
Returns the amount that we need to subtract from the containing block size in order to obtain the inset-modified containing block that we will use for sizing purposes. (Note that for alignment purposes, we may re-resolve auto insets to a different value.) https://drafts.csswg.org/css-position/#resolving-insets
sourcefn solve(
&self,
get_content_size: Option<impl FnOnce() -> ContentSizes>,
) -> AxisResult
fn solve( &self, get_content_size: Option<impl FnOnce() -> ContentSizes>, ) -> AxisResult
This unifies some of the parts in common in:
- https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width
- https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-height
… and:
- https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
- https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
In the replaced case, size
is never Auto
.
fn solve_tentatively(&mut self) -> AxisResult
fn override_size(&mut self, size: Au)
fn origin_for_margin_box( &self, axis: AxisDirection, size: Au, self_writing_mode: WritingMode, original_parent_writing_mode: WritingMode, containing_block_writing_mode: WritingMode, ) -> Au
Auto Trait Implementations§
impl<'a> Freeze for AbsoluteAxisSolver<'a>
impl<'a> RefUnwindSafe for AbsoluteAxisSolver<'a>
impl<'a> Send for AbsoluteAxisSolver<'a>
impl<'a> Sync for AbsoluteAxisSolver<'a>
impl<'a> Unpin for AbsoluteAxisSolver<'a>
impl<'a> UnwindSafe for AbsoluteAxisSolver<'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