pub(crate) struct PositionInInlineFormattingContext {
container: LayoutBox,
offset: Utf32CodeUnits,
text_run: ArcRefCell<TextRun>,
}Fields§
§container: LayoutBoxThe LayoutBox of the containing inline formatting context box.
offset: Utf32CodeUnitsThe offset of this position in the inline formatting context’s transformed text.
text_run: ArcRefCell<TextRun>The TextRun that contains this position.
Implementations§
Source§impl PositionInInlineFormattingContext
impl PositionInInlineFormattingContext
Sourcepub(crate) fn from_dom_position_in_text_node(
node: &ServoLayoutNode<'_>,
offset: Utf32CodeUnitsOrNodeOffset,
) -> Option<Self>
pub(crate) fn from_dom_position_in_text_node( node: &ServoLayoutNode<'_>, offset: Utf32CodeUnitsOrNodeOffset, ) -> Option<Self>
If the given text node and a DOM offset in that node are contained within an
inline formatting context, create a PositionInInlineFormattingContext for
them. If the node is not a text node or the containing inline formatting context
cannot be found return None.
Sourcefn offsets(&self, granularity: SegmentGranularity) -> Range<Utf32CodeUnits>
fn offsets(&self, granularity: SegmentGranularity) -> Range<Utf32CodeUnits>
Return the offsets of the segment with the given SegmentGranularity at this position.
Sourcepub(crate) fn segment(
&self,
granularity: SegmentGranularity,
) -> Option<((OpaqueNode, Utf32CodeUnitsOrNodeOffset), (OpaqueNode, Utf32CodeUnitsOrNodeOffset))>
pub(crate) fn segment( &self, granularity: SegmentGranularity, ) -> Option<((OpaqueNode, Utf32CodeUnitsOrNodeOffset), (OpaqueNode, Utf32CodeUnitsOrNodeOffset))>
Find the segment boundaries of the segment with the given SegmentGranularity
at this position.
Auto Trait Implementations§
impl Freeze for PositionInInlineFormattingContext
impl !RefUnwindSafe for PositionInInlineFormattingContext
impl Send for PositionInInlineFormattingContext
impl Sync for PositionInInlineFormattingContext
impl Unpin for PositionInInlineFormattingContext
impl UnsafeUnpin for PositionInInlineFormattingContext
impl !UnwindSafe for PositionInInlineFormattingContext
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> 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>
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