Struct layout_2020::flow::inline::InlineFormattingContext
source · pub(crate) struct InlineFormattingContext {
pub(super) inline_items: Vec<ArcRefCell<InlineItem>>,
pub(super) inline_boxes: InlineBoxes,
pub(super) text_content: String,
pub font_metrics: Vec<FontKeyAndMetrics>,
pub(super) text_decoration_line: TextDecorationLine,
pub(super) has_first_formatted_line: bool,
pub(super) contains_floats: bool,
pub(super) is_single_line_text_input: bool,
pub(super) has_right_to_left_content: bool,
}
Fields§
§inline_items: Vec<ArcRefCell<InlineItem>>
All InlineItem
s in this InlineFormattingContext
stored in a flat array.
InlineItem::StartInlineBox
and InlineItem::EndInlineBox
allow representing
the tree of inline boxes within the formatting context, but a flat array allows
easy iteration through all inline items.
inline_boxes: InlineBoxes
The tree of inline boxes in this InlineFormattingContext
. These are stored in
a flat array with each being given a InlineBoxIdentifier
.
text_content: String
The text content of this inline formatting context.
font_metrics: Vec<FontKeyAndMetrics>
A store of font information for all the shaped segments in this formatting context in order to avoid duplicating this information.
text_decoration_line: TextDecorationLine
§has_first_formatted_line: bool
Whether this IFC contains the 1st formatted line of an element: https://www.w3.org/TR/css-pseudo-4/#first-formatted-line.
contains_floats: bool
Whether or not this InlineFormattingContext
contains floats.
is_single_line_text_input: bool
Whether or not this is an InlineFormattingContext
for a single line text input.
has_right_to_left_content: bool
Whether or not this is an InlineFormattingContext
has right-to-left content, which
will require reordering during layout.
Implementations§
source§impl InlineFormattingContext
impl InlineFormattingContext
pub(super) fn new_with_builder( builder: InlineFormattingContextBuilder, layout_context: &LayoutContext<'_>, text_decoration_line: TextDecorationLine, has_first_formatted_line: bool, is_single_line_text_input: bool, starting_bidi_level: Level, ) -> Self
pub(super) fn layout( &self, layout_context: &LayoutContext<'_>, positioning_context: &mut PositioningContext, containing_block: &ContainingBlock<'_>, sequential_layout_state: Option<&mut SequentialLayoutState>, collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, ) -> FlowLayout
fn next_character_prevents_soft_wrap_opportunity(&self, index: usize) -> bool
fn previous_character_prevents_soft_wrap_opportunity( &self, index: usize, ) -> bool
Trait Implementations§
source§impl ComputeInlineContentSizes for InlineFormattingContext
impl ComputeInlineContentSizes for InlineFormattingContext
fn compute_inline_content_sizes( &self, layout_context: &LayoutContext<'_>, constraint_space: &ConstraintSpace, ) -> InlineContentSizesResult
source§impl Debug for InlineFormattingContext
impl Debug for InlineFormattingContext
Auto Trait Implementations§
impl Freeze for InlineFormattingContext
impl !RefUnwindSafe for InlineFormattingContext
impl Send for InlineFormattingContext
impl Sync for InlineFormattingContext
impl Unpin for InlineFormattingContext
impl !UnwindSafe for InlineFormattingContext
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