pub enum InlineItem {
Text {
content: Arc<str>,
style: Arc<ComputedValues>,
measured_width: f32,
measured_height: f32,
baseline: f32,
},
OpenTag {
style: Arc<ComputedValues>,
margin_inline_start: f32,
border_inline_start: f32,
padding_inline_start: f32,
},
CloseTag {
margin_inline_end: f32,
border_inline_end: f32,
padding_inline_end: f32,
},
AtomicInline {
width: f32,
height: f32,
baseline: f32,
layout_id: u32,
style: Arc<ComputedValues>,
},
ForcedBreak,
}Expand description
An item in the inline formatting context.
Chrome equivalent: NGInlineItem with its type.
Variants§
Text
A text run — a segment of text with uniform style. The text will be shaped (future: via Parley/harfrust).
Fields
§
style: Arc<ComputedValues>Style for this text (font, color, etc.).
OpenTag
Open tag — start of an inline element (e.g., <span>).
Chrome: kOpenTag.
Fields
§
style: Arc<ComputedValues>CloseTag
Close tag — end of an inline element.
Chrome: kCloseTag.
Fields
AtomicInline
An atomic inline — an inline-block, replaced element (img), etc. These are measured as a single unit and cannot be broken across lines.
Fields
§
style: Arc<ComputedValues>Style for this atomic inline (vertical-align, etc.).
ForcedBreak
A forced line break (<br>).
Implementations§
Source§impl InlineItem
impl InlineItem
Sourcepub fn inline_size(&self) -> f32
pub fn inline_size(&self) -> f32
Get the inline size (width) of this item.
Sourcepub fn is_forced_break(&self) -> bool
pub fn is_forced_break(&self) -> bool
Whether this item forces a line break.
Sourcepub fn is_breakable(&self) -> bool
pub fn is_breakable(&self) -> bool
Whether this item is breakable (text can be split across lines).
Trait Implementations§
Source§impl Clone for InlineItem
impl Clone for InlineItem
Source§fn clone(&self) -> InlineItem
fn clone(&self) -> InlineItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InlineItem
impl !RefUnwindSafe for InlineItem
impl Send for InlineItem
impl Sync for InlineItem
impl Unpin for InlineItem
impl UnsafeUnpin for InlineItem
impl !UnwindSafe for InlineItem
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert