pub(crate) struct HoistedSharedFragment {
pub fragment: Option<ArcRefCell<Fragment>>,
pub static_position_rect: PhysicalRect<Au>,
pub resolved_alignment: LogicalVec2<AlignFlags>,
pub original_parent_writing_mode: WritingMode,
}
Expand description
A reference to a Fragment which is shared between HoistedAbsolutelyPositionedBox
and its placeholder AbsoluteOrFixedPositionedFragment
in the original tree position.
This will be used later in order to paint this hoisted box in tree order.
Fields§
§fragment: Option<ArcRefCell<Fragment>>
§static_position_rect: PhysicalRect<Au>
The “static-position rect” of this absolutely positioned box. This is defined by the layout mode from which the box originates.
resolved_alignment: LogicalVec2<AlignFlags>
The resolved alignment values used for aligning this absolutely positioned element if the “static-position rect” ends up being the “inset-modified containing block”. These values are dependent on the layout mode (currently only interesting for flexbox).
original_parent_writing_mode: WritingMode
This is the WritingMode
of the original parent of the element that created this
hoisted absolutely-positioned fragment. This helps to interpret the offset for
static positioning. If the writing mode is right-to-left or bottom-to-top, the static
offset needs to be adjusted by the absolutely positioned element’s inline size.
Implementations§
pub(crate) fn new( static_position_rect: PhysicalRect<Au>, resolved_alignment: LogicalVec2<AlignFlags>, original_parent_writing_mode: WritingMode, ) -> Self
sourcepub(crate) fn adjust_offsets(&mut self, offset: &PhysicalVec<Au>)
pub(crate) fn adjust_offsets(&mut self, offset: &PhysicalVec<Au>)
inset: auto
-positioned elements do not know their precise position until after
they’re hoisted. This lets us adjust auto values after the fact.
Trait Implementations§
Auto Trait Implementations§
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 more