pub(crate) struct SharedTextRunData {
pub inline_styles: SharedInlineStyles,
pub character_range_in_ifc_text: Range<usize>,
pub original_offset: Utf32CodeUnits,
pub selection: Option<SharedSelection>,
pub offset_map: ArcRefCell<OffsetMap>,
}Expand description
A data structure that holds per-TextRun data used on TextFragments.
This ensures that the data is not duplicated between fragments.
Fields§
§inline_styles: SharedInlineStylesThe crate::SharedStyle from this TextRun’s parent element. This is
shared so that incremental layout can simply update the parent element and
this TextRun will be updated automatically.
character_range_in_ifc_text: Range<usize>The range of characters in this text in InlineFormattingContext::text_content
of the InlineFormattingContext that owns this TextRun. These are counting
chars, not UTF-8 offsets.
original_offset: Utf32CodeUnitsThe original offset of this TextRun in the InlineFormattingContext’s input
text (untransformed by white space collapse and text-transform).
selection: Option<SharedSelection>The selected text in this TextRun. This may either be document selection or form control
selection.
offset_map: ArcRefCell<OffsetMap>The OffsetMap used when creating this TextRun’s InlineFormattingContext. This
is used for mapping between DOM text offsets and layout text offsets (and vice-versa).
Implementations§
Sourcepub(crate) fn map_dom_range_to_transformed_range(
&self,
range: Range<Utf32CodeUnits>,
) -> Range<Utf32CodeUnits> ⓘ
pub(crate) fn map_dom_range_to_transformed_range( &self, range: Range<Utf32CodeUnits>, ) -> Range<Utf32CodeUnits> ⓘ
Map a range in the originating TextRun’s DOM node text into the range in the
TextRun’s layout transformed (by white space collapse and text-transform)
text.
Sourcepub(crate) fn map_transformed_offset_to_dom_offset(
&self,
offset: Utf32CodeUnits,
) -> Utf32CodeUnits
pub(crate) fn map_transformed_offset_to_dom_offset( &self, offset: Utf32CodeUnits, ) -> Utf32CodeUnits
Map an offset in the originating TextRuns DOM node’s transformed text (by white
space collapse and text-transform) to untransformed text for use by the DOM.
Trait Implementations§
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Auto Trait Implementations§
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