Struct layout_2013::inline::InlineFlow
source · #[repr(C)]pub struct InlineFlow {
pub base: BaseFlow,
pub fragments: InlineFragments,
pub lines: Vec<Line>,
pub minimum_line_metrics: LineMetrics,
pub first_line_indentation: Au,
}
Expand description
Flows for inline layout.
Fields§
§base: BaseFlow
Data common to all flows.
fragments: InlineFragments
A vector of all inline fragments. Several fragments may correspond to one node/element.
lines: Vec<Line>
A vector of ranges into fragments that represents line positions. These ranges are disjoint and are the result of inline layout. This also includes some metadata used for positioning lines.
minimum_line_metrics: LineMetrics
The minimum metrics for each line, as specified by the line height and font style.
first_line_indentation: Au
The amount of indentation to use on the first line. This is determined by our block parent (because percentages are relative to the containing block, and we aren’t in a position to compute things relative to our parent’s containing block).
Implementations§
source§impl InlineFlow
impl InlineFlow
pub fn from_fragments( fragments: InlineFragments, writing_mode: WritingMode, ) -> InlineFlow
sourcefn set_inline_fragment_positions(
fragments: &mut InlineFragments,
line: &Line,
line_align: TextAlign,
indentation: Au,
is_last_line: bool,
)
fn set_inline_fragment_positions( fragments: &mut InlineFragments, line: &Line, line_align: TextAlign, indentation: Au, is_last_line: bool, )
Sets fragment positions in the inline direction based on alignment for one line. This performs text justification if mandated by the style.
sourcefn justify_inline_fragments(
fragments: &mut InlineFragments,
line: &Line,
slack_inline_size: Au,
)
fn justify_inline_fragments( fragments: &mut InlineFragments, line: &Line, slack_inline_size: Au, )
Justifies the given set of inline fragments, distributing the slack_inline_size
among all
of them according to the value of text-justify
.
sourcefn set_block_fragment_positions(
fragments: &mut InlineFragments,
line: &Line,
minimum_line_metrics: &LineMetrics,
layout_context: &LayoutContext<'_>,
)
fn set_block_fragment_positions( fragments: &mut InlineFragments, line: &Line, minimum_line_metrics: &LineMetrics, layout_context: &LayoutContext<'_>, )
Sets final fragment positions in the block direction for one line.
sourcepub fn minimum_line_metrics(
&self,
font_context: &FontContext,
style: &ComputedValues,
) -> LineMetrics
pub fn minimum_line_metrics( &self, font_context: &FontContext, style: &ComputedValues, ) -> LineMetrics
Computes the minimum metrics for each line. This is done during flow construction.
style
is the style of the block.
sourcepub fn minimum_line_metrics_for_fragments(
fragments: &[Fragment],
font_context: &FontContext,
style: &ComputedValues,
) -> LineMetrics
pub fn minimum_line_metrics_for_fragments( fragments: &[Fragment], font_context: &FontContext, style: &ComputedValues, ) -> LineMetrics
Computes the minimum line metrics for the given fragments. This is typically done during flow construction.
style
is the style of the block that these fragments belong to.
fn update_restyle_damage(&mut self)
fn containing_block_range_for_flow_surrounding_fragment_at_index( &self, fragment_index: FragmentIndex, ) -> Range<FragmentIndex>
fn containing_block_range_for_flow( &self, opaque_flow: OpaqueFlow, ) -> Range<FragmentIndex>
pub fn baseline_offset_of_last_line(&self) -> Option<Au>
fn last_line_containing_real_fragments(&self) -> Option<&Line>
fn build_display_list_for_inline_fragment_at_index( &mut self, state: &mut DisplayListBuildState<'_>, index: usize, )
Trait Implementations§
source§impl Debug for InlineFlow
impl Debug for InlineFlow
source§impl Flow for InlineFlow
impl Flow for InlineFlow
source§fn assign_inline_sizes(&mut self, _: &LayoutContext<'_>)
fn assign_inline_sizes(&mut self, _: &LayoutContext<'_>)
Recursively (top-down) determines the actual inline-size of child contexts and fragments. When called on this context, the context has had its inline-size set by the parent context.
source§fn assign_block_size(&mut self, layout_context: &LayoutContext<'_>)
fn assign_block_size(&mut self, layout_context: &LayoutContext<'_>)
Calculate and set the block-size of this flow. See CSS 2.1 § 10.6.1. Note that we do not need to do in-order traversal because the children are always block formatting context.
source§fn as_inline(&self) -> &InlineFlow
fn as_inline(&self) -> &InlineFlow
source§fn as_mut_inline(&mut self) -> &mut InlineFlow
fn as_mut_inline(&mut self) -> &mut InlineFlow
source§fn bubble_inline_sizes(&mut self)
fn bubble_inline_sizes(&mut self)
source§fn compute_stacking_relative_position(&mut self, _: &LayoutContext<'_>)
fn compute_stacking_relative_position(&mut self, _: &LayoutContext<'_>)
source§fn update_late_computed_inline_position_if_necessary(&mut self, _: Au)
fn update_late_computed_inline_position_if_necessary(&mut self, _: Au)
source§fn update_late_computed_block_position_if_necessary(&mut self, _: Au)
fn update_late_computed_block_position_if_necessary(&mut self, _: Au)
fn collect_stacking_contexts( &mut self, state: &mut StackingContextCollectionState, )
source§fn build_display_list(&mut self, state: &mut DisplayListBuildState<'_>)
fn build_display_list(&mut self, state: &mut DisplayListBuildState<'_>)
source§fn repair_style(&mut self, _: &ServoArc<ComputedValues>)
fn repair_style(&mut self, _: &ServoArc<ComputedValues>)
source§fn compute_overflow(&self) -> Overflow
fn compute_overflow(&self) -> Overflow
source§fn iterate_through_fragment_border_boxes(
&self,
iterator: &mut dyn FragmentBorderBoxIterator,
level: i32,
stacking_context_position: &Point2D<Au>,
)
fn iterate_through_fragment_border_boxes( &self, iterator: &mut dyn FragmentBorderBoxIterator, level: i32, stacking_context_position: &Point2D<Au>, )
source§fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment))
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment))
fn contains_positioned_fragments(&self) -> bool
fn contains_relatively_positioned_fragments(&self) -> bool
source§fn generated_containing_block_size(
&self,
for_flow: OpaqueFlow,
) -> LogicalSize<Au>
fn generated_containing_block_size( &self, for_flow: OpaqueFlow, ) -> LogicalSize<Au>
for_flow
. For block flows, this is the padding box. Read moresource§fn print_extra_flow_children(&self, print_tree: &mut PrintTree)
fn print_extra_flow_children(&self, print_tree: &mut PrintTree)
source§fn as_block(&self) -> &BlockFlow
fn as_block(&self) -> &BlockFlow
source§fn as_mut_block(&mut self) -> &mut BlockFlow
fn as_mut_block(&mut self) -> &mut BlockFlow
source§fn as_flex(&self) -> &FlexFlow
fn as_flex(&self) -> &FlexFlow
source§fn as_table_wrapper(&self) -> &TableWrapperFlow
fn as_table_wrapper(&self) -> &TableWrapperFlow
source§fn as_mut_table(&mut self) -> &mut TableFlow
fn as_mut_table(&mut self) -> &mut TableFlow
source§fn as_table(&self) -> &TableFlow
fn as_table(&self) -> &TableFlow
source§fn as_mut_table_colgroup(&mut self) -> &mut TableColGroupFlow
fn as_mut_table_colgroup(&mut self) -> &mut TableColGroupFlow
source§fn as_table_colgroup(&self) -> &TableColGroupFlow
fn as_table_colgroup(&self) -> &TableColGroupFlow
source§fn as_mut_table_rowgroup(&mut self) -> &mut TableRowGroupFlow
fn as_mut_table_rowgroup(&mut self) -> &mut TableRowGroupFlow
source§fn as_table_rowgroup(&self) -> &TableRowGroupFlow
fn as_table_rowgroup(&self) -> &TableRowGroupFlow
source§fn as_mut_table_row(&mut self) -> &mut TableRowFlow
fn as_mut_table_row(&mut self) -> &mut TableRowFlow
source§fn as_table_row(&self) -> &TableRowFlow
fn as_table_row(&self) -> &TableRowFlow
source§fn as_mut_table_cell(&mut self) -> &mut TableCellFlow
fn as_mut_table_cell(&mut self) -> &mut TableCellFlow
source§fn as_table_cell(&self) -> &TableCellFlow
fn as_table_cell(&self) -> &TableCellFlow
source§fn fragment(
&mut self,
layout_context: &LayoutContext<'_>,
_fragmentation_context: Option<FragmentationContext>,
) -> Option<Arc<dyn Flow>>
fn fragment( &mut self, layout_context: &LayoutContext<'_>, _fragmentation_context: Option<FragmentationContext>, ) -> Option<Arc<dyn Flow>>
assign_block_size
, but is recurses explicitly into descendants.
Fit as much content as possible within available_block_size
.
If that’s not all of it, truncate the contents of self
and return a new flow similar to self
with the rest of the content. Read moresource§fn place_float_if_applicable(&mut self)
fn place_float_if_applicable(&mut self)
source§fn assign_block_size_for_inorder_child_if_necessary(
&mut self,
layout_context: &LayoutContext<'_>,
parent_thread_id: u8,
_content_box: LogicalRect<Au>,
) -> bool
fn assign_block_size_for_inorder_child_if_necessary( &mut self, layout_context: &LayoutContext<'_>, parent_thread_id: u8, _content_box: LogicalRect<Au>, ) -> bool
fn has_non_invertible_transform_or_zero_scale(&self) -> bool
fn get_overflow_in_parent_coordinates(&self) -> Overflow
source§fn store_overflow(&mut self, _: &LayoutContext<'_>)
fn store_overflow(&mut self, _: &LayoutContext<'_>)
source§fn mark_as_root(&mut self)
fn mark_as_root(&mut self)
fn is_root(&self) -> bool
source§fn positioning(&self) -> Position
fn positioning(&self) -> Position
source§fn is_absolute_containing_block(&self) -> bool
fn is_absolute_containing_block(&self) -> bool
source§fn contains_roots_of_absolute_flow_tree(&self) -> bool
fn contains_roots_of_absolute_flow_tree(&self) -> bool
fn clipping_and_scrolling(&self) -> ClippingAndScrolling
source§impl Serialize for InlineFlow
impl Serialize for InlineFlow
impl HasBaseFlow for InlineFlow
Auto Trait Implementations§
impl !Freeze for InlineFlow
impl !RefUnwindSafe for InlineFlow
impl Send for InlineFlow
impl Sync for InlineFlow
impl Unpin for InlineFlow
impl !UnwindSafe for InlineFlow
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> GetBaseFlow for Twhere
T: HasBaseFlow + ?Sized,
impl<T> GetBaseFlow for Twhere
T: HasBaseFlow + ?Sized,
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