struct LineUnderConstruction {
start_position: LogicalVec2<Au>,
inline_position: Au,
max_block_size: LineBlockSizes,
has_content: bool,
has_inline_pbm: bool,
has_floats_waiting_to_be_placed: bool,
placement_among_floats: OnceCell<LogicalRect<Au>>,
line_items: Vec<LineItem>,
}Expand description
Information about the current line under construction for a particular
InlineFormattingContextLayout. This tracks position and size information while
LineItems are collected and is used as input when those LineItems are
converted into Fragments during the final phase of line layout. Note that this
does not store the LineItems themselves, as they are stored as part of the
nesting state in the InlineFormattingContextLayout.
Fields§
§start_position: LogicalVec2<Au>The position where this line will start once it is laid out. This includes any
offset from text-indent.
inline_position: AuThe current inline position in the line being laid out into LineItems in this
InlineFormattingContext independent of the depth in the nesting level.
max_block_size: LineBlockSizesThe maximum block size of all boxes that ended and are in progress in this line.
This uses LineBlockSizes instead of a simple value, because the final block size
depends on vertical alignment.
has_content: boolWhether any active linebox has added a glyph or atomic element to this line, which indicates that the next run that exceeds the line length can cause a line break.
has_inline_pbm: boolWhether any active linebox has added some inline-axis padding, border or margin to this line.
has_floats_waiting_to_be_placed: boolWhether or not there are floats that did not fit on the current line. Before
the LineItems of this line are laid out, these floats will need to be
placed directly below this line, but still as children of this line’s Fragments.
placement_among_floats: OnceCell<LogicalRect<Au>>A rectangular area (relative to the containing block / inline formatting
context boundaries) where we can fit the line box without overlapping floats.
Note that when this is not empty, its start corner takes precedence over
LineUnderConstruction::start_position.
line_items: Vec<LineItem>The LineItems for the current line under construction that have already been committed to this line.
Implementations§
Source§impl LineUnderConstruction
impl LineUnderConstruction
fn new(start_position: LogicalVec2<Au>) -> Self
fn line_block_start_considering_placement_among_floats(&self) -> Au
fn replace_placement_among_floats(&mut self, new_placement: LogicalRect<Au>)
Sourcefn trim_trailing_whitespace(&mut self) -> Au
fn trim_trailing_whitespace(&mut self) -> Au
Trim the trailing whitespace in this line and return the width of the whitespace trimmed.
Sourcefn count_justification_opportunities(&self) -> usize
fn count_justification_opportunities(&self) -> usize
Count the number of justification opportunities in this line.
Auto Trait Implementations§
impl !Freeze for LineUnderConstruction
impl !RefUnwindSafe for LineUnderConstruction
impl Send for LineUnderConstruction
impl !Sync for LineUnderConstruction
impl Unpin for LineUnderConstruction
impl !UnwindSafe for LineUnderConstruction
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