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

source

pub fn from_fragments( fragments: InlineFragments, writing_mode: WritingMode, ) -> InlineFlow

source

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.

source

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.

source

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.

source

pub fn minimum_line_metrics( &self, font_context: &LayoutFontContext, style: &ComputedValues, ) -> LineMetrics

Computes the minimum metrics for each line. This is done during flow construction.

style is the style of the block.

source

pub fn minimum_line_metrics_for_fragments( fragments: &[Fragment], font_context: &LayoutFontContext, 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.

source

fn update_restyle_damage(&mut self)

source

fn containing_block_range_for_flow_surrounding_fragment_at_index( &self, fragment_index: FragmentIndex, ) -> Range<FragmentIndex>

source

fn containing_block_range_for_flow( &self, opaque_flow: OpaqueFlow, ) -> Range<FragmentIndex>

source

pub fn baseline_offset_of_last_line(&self) -> Option<Au>

source

fn last_line_containing_real_fragments(&self) -> Option<&Line>

source

fn build_display_list_for_inline_fragment_at_index( &mut self, state: &mut DisplayListBuildState<'_>, index: usize, )

Trait Implementations§

source§

impl Debug for InlineFlow

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Flow for InlineFlow

source§

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<'_>)

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 class(&self) -> FlowClass

Returns the class of flow that this is.
source§

fn as_inline(&self) -> &InlineFlow

If this is an inline flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_inline(&mut self) -> &mut InlineFlow

If this is an inline flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn bubble_inline_sizes(&mut self)

Pass 1 of reflow: computes minimum and preferred inline-sizes. Read more
source§

fn compute_stacking_relative_position(&mut self, _: &LayoutContext<'_>)

Phase 4 of reflow: Compute the stacking-relative position (origin of the content box, in coordinates relative to the nearest ancestor stacking context).
source§

fn update_late_computed_inline_position_if_necessary(&mut self, _: Au)

Updates the inline position of a child flow during the assign-height traversal. At present, this is only used for absolutely-positioned inline-blocks.
source§

fn update_late_computed_block_position_if_necessary(&mut self, _: Au)

Updates the block position of a child flow during the assign-height traversal. At present, this is only used for absolutely-positioned inline-blocks.
source§

fn collect_stacking_contexts( &mut self, state: &mut StackingContextCollectionState, )

source§

fn build_display_list(&mut self, state: &mut DisplayListBuildState<'_>)

Phase 5 of reflow: builds display lists.
source§

fn repair_style(&mut self, _: &ServoArc<ComputedValues>)

Attempts to perform incremental fixup of this flow by replacing its fragment’s style with the new style. This can only succeed if the flow has exactly one fragment.
source§

fn compute_overflow(&self) -> Overflow

Returns the union of all overflow rects of all of this flow’s fragments.
source§

fn iterate_through_fragment_border_boxes( &self, iterator: &mut dyn FragmentBorderBoxIterator, level: i32, stacking_context_position: &Point2D<Au>, )

Iterates through border boxes of all of this flow’s fragments. Level provides a zero based index indicating the current depth of the flow tree during fragment iteration.
source§

fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment))

Mutably iterates through fragments in this flow.
source§

fn contains_positioned_fragments(&self) -> bool

source§

fn contains_relatively_positioned_fragments(&self) -> bool

source§

fn generated_containing_block_size( &self, for_flow: OpaqueFlow, ) -> LogicalSize<Au>

Return the size of the containing block generated by this flow for the absolutely- positioned descendant referenced by for_flow. For block flows, this is the padding box. Read more
source§

fn print_extra_flow_children(&self, print_tree: &mut PrintTree)

Print any extra children (such as fragments) contained in this Flow for debugging purposes. Any items inserted into the tree will become children of this flow.
source§

fn as_block(&self) -> &BlockFlow

If this is a block flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_block(&mut self) -> &mut BlockFlow

If this is a block flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn as_flex(&self) -> &FlexFlow

If this is a flex flow, returns the underlying object. Fails otherwise.
source§

fn as_table_wrapper(&self) -> &TableWrapperFlow

If this is a table wrapper flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_table(&mut self) -> &mut TableFlow

If this is a table flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn as_table(&self) -> &TableFlow

If this is a table flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_table_colgroup(&mut self) -> &mut TableColGroupFlow

If this is a table colgroup flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn as_table_colgroup(&self) -> &TableColGroupFlow

If this is a table colgroup flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_table_rowgroup(&mut self) -> &mut TableRowGroupFlow

If this is a table rowgroup flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn as_table_rowgroup(&self) -> &TableRowGroupFlow

If this is a table rowgroup flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_table_row(&mut self) -> &mut TableRowFlow

If this is a table row flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn as_table_row(&self) -> &TableRowFlow

If this is a table row flow, returns the underlying object. Fails otherwise.
source§

fn as_mut_table_cell(&mut self) -> &mut TableCellFlow

If this is a table cell flow, returns the underlying object, borrowed mutably. Fails otherwise.
source§

fn as_table_cell(&self) -> &TableCellFlow

If this is a table cell flow, returns the underlying object. Fails otherwise.
source§

fn fragment( &mut self, layout_context: &LayoutContext<'_>, _fragmentation_context: Option<FragmentationContext>, ) -> Option<Arc<dyn Flow>>

Like 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 more
source§

fn place_float_if_applicable(&mut self)

If this is a float, places it. The default implementation does nothing.
source§

fn assign_block_size_for_inorder_child_if_necessary( &mut self, layout_context: &LayoutContext<'_>, parent_thread_id: u8, _content_box: LogicalRect<Au>, ) -> bool

Assigns block-sizes in-order; or, if this is a float, places the float. The default implementation simply assigns block-sizes if this flow might have floats in. Returns true if it was determined that this child might have had floats in or false otherwise. Read more
source§

fn has_non_invertible_transform_or_zero_scale(&self) -> bool

source§

fn get_overflow_in_parent_coordinates(&self) -> Overflow

source§

fn store_overflow(&mut self, _: &LayoutContext<'_>)

CSS Section 11.1 This is the union of rectangles of the flows for which we define the Containing Block. Read more
source§

fn mark_as_root(&mut self)

Marks this flow as the root flow. The default implementation is a no-op.
source§

fn is_root(&self) -> bool

source§

fn positioning(&self) -> Position

The ‘position’ property of this flow.
source§

fn is_fixed(&self) -> bool

Return true if this flow has position ‘fixed’.
source§

fn is_absolute_containing_block(&self) -> bool

Returns true if this is an absolute containing block.
source§

fn contains_roots_of_absolute_flow_tree(&self) -> bool

Returns true if this flow contains fragments that are roots of an absolute flow tree.
source§

fn clipping_and_scrolling(&self) -> ClippingAndScrolling

source§

impl Serialize for InlineFlow

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl HasBaseFlow for InlineFlow

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> GetBaseFlow for T
where T: HasBaseFlow + ?Sized,

source§

fn base(&self) -> &BaseFlow

source§

fn mut_base(&mut self) -> &mut BaseFlow

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,