Struct layout_2020::flow::inline::line::LineItemLayout
source · pub(super) struct LineItemLayout<'layout_data, 'layout> {
layout: &'layout mut InlineFormattingContextLayout<'layout_data>,
pub state_stack: Vec<LineItemLayoutInlineContainerState>,
pub current_state: LineItemLayoutInlineContainerState,
pub line_metrics: LineMetrics,
pub justification_adjustment: Au,
}
Expand description
The second phase of super::InlineFormattingContext
layout: once items are gathered
for a line, we must lay them out and create fragments for them, properly positioning them
according to their baselines and also handling absolutely positioned children.
Fields§
§layout: &'layout mut InlineFormattingContextLayout<'layout_data>
The state of the overall super::InlineFormattingContext
layout.
state_stack: Vec<LineItemLayoutInlineContainerState>
The set of LineItemLayoutInlineContainerState
created while laying out items
on this line. This does not include the current level of recursion.
current_state: LineItemLayoutInlineContainerState
The current LineItemLayoutInlineContainerState
.
line_metrics: LineMetrics
The metrics of this line, which should remain constant throughout the layout process.
justification_adjustment: Au
The amount of space to add to each justification opportunity in order to implement
text-align: justify
.
Implementations§
source§impl<'layout_data, 'layout> LineItemLayout<'layout_data, 'layout>
impl<'layout_data, 'layout> LineItemLayout<'layout_data, 'layout>
pub(super) fn layout_line_items( layout: &mut InlineFormattingContextLayout<'_>, line_items: Vec<LineItem>, start_position: LogicalVec2<Au>, effective_block_advance: &LineBlockSizes, justification_adjustment: Au, ) -> Vec<Fragment>
sourcefn prepare_layout_for_inline_box(
&mut self,
new_inline_box: Option<InlineBoxIdentifier>,
)
fn prepare_layout_for_inline_box( &mut self, new_inline_box: Option<InlineBoxIdentifier>, )
Start and end inline boxes in tree order, so that it reflects the given inline box.
pub(super) fn layout(&mut self, line_items: Vec<LineItem>) -> Vec<Fragment>
fn current_positioning_context_mut(&mut self) -> &mut PositioningContext
fn start_inline_box(&mut self, identifier: &InlineBoxIdentifier)
fn end_inline_box(&mut self)
fn calculate_inline_box_block_start( &self, inline_box_state: &InlineBoxContainerState, space_above_baseline: Au, ) -> Au
fn layout_text_run(&mut self, text_item: TextRunLineItem)
fn layout_atomic(&mut self, atomic: AtomicLineItem)
fn layout_absolute(&mut self, absolute: AbsolutelyPositionedLineItem)
fn layout_float(&mut self, float: FloatLineItem)
Auto Trait Implementations§
impl<'layout_data, 'layout> Freeze for LineItemLayout<'layout_data, 'layout>
impl<'layout_data, 'layout> !RefUnwindSafe for LineItemLayout<'layout_data, 'layout>
impl<'layout_data, 'layout> !Send for LineItemLayout<'layout_data, 'layout>
impl<'layout_data, 'layout> !Sync for LineItemLayout<'layout_data, 'layout>
impl<'layout_data, 'layout> Unpin for LineItemLayout<'layout_data, 'layout>
impl<'layout_data, 'layout> !UnwindSafe for LineItemLayout<'layout_data, 'layout>
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