struct FragmentAndData {
fragment: Fragment,
logical_rect: LogicalRect<Au>,
propagated_floats: Vec<Arc<BoxFragment>>,
}Fields§
§fragment: Fragment§logical_rect: LogicalRect<Au>The logical rectangle of the fragment, relative within the current inline box (or line).
This logical rectangle will be converted into a physical one, and the Fragment’s
content_rect will be updated once the inline box’s final size is known in
LineItemLayout::end_inline_box.
propagated_floats: Vec<Arc<BoxFragment>>If the fragment is for an inline box, this is the list of floats which are either direct children or descendants within other inline boxes. Once the final physical rect of the fragment is known, the position of these floats needs to be adjusted.
Implementations§
Source§impl FragmentAndData
impl FragmentAndData
fn new(fragment: Fragment, logical_rect: LogicalRect<Au>) -> Self
fn new_with_propagated_floats( fragment: Fragment, logical_rect: LogicalRect<Au>, propagated_floats: Vec<Arc<BoxFragment>>, ) -> Self
Sourcefn resolve_physical_rect_and_adjust_floats(
&self,
container: &ContainingBlock<'_>,
)
fn resolve_physical_rect_and_adjust_floats( &self, container: &ContainingBlock<'_>, )
Updates the physical rect of the fragment, by resolving the logical rect against the size and writing mode of the container. Note that the container isn’t necessarily the containing block, it can be a fragment of an inline box. This shouldn’t be used for floats, since they are anchored to a side of the inline formatting context, not to their container.
Sourcefn resolve_physical_rects_and_adjust_floats(
fragments_and_data: Vec<Self>,
container: &ContainingBlock<'_>,
) -> Vec<Fragment>
fn resolve_physical_rects_and_adjust_floats( fragments_and_data: Vec<Self>, container: &ContainingBlock<'_>, ) -> Vec<Fragment>
Given a vector of FragmentAndData, this resolves the final physical rect for each
non-floating fragment (storing it), and adjusts the position of the floats inside it,
then returns a vector with the Fragments.
Sourcefn resolve_physical_rects_and_adjust_and_collect_floats(
fragments_and_data: Vec<Self>,
container: &ContainingBlock<'_>,
relative_adjustement: PhysicalSize<Au>,
) -> (Vec<Fragment>, Vec<Arc<BoxFragment>>)
fn resolve_physical_rects_and_adjust_and_collect_floats( fragments_and_data: Vec<Self>, container: &ContainingBlock<'_>, relative_adjustement: PhysicalSize<Au>, ) -> (Vec<Fragment>, Vec<Arc<BoxFragment>>)
Same as [resolve_physical_rects_and_adjust_floats()], but additionally it takes
a relative adjustment that will be applied to floats. And the return value is a
pair of the Fragments and the propagated floats.
Auto Trait Implementations§
impl Freeze for FragmentAndData
impl !RefUnwindSafe for FragmentAndData
impl Send for FragmentAndData
impl Sync for FragmentAndData
impl Unpin for FragmentAndData
impl UnsafeUnpin for FragmentAndData
impl !UnwindSafe for FragmentAndData
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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