Skip to main content

Module text_transform

Module text_transform 

Source
Expand description

ยงLogic for text transform in inline formatting contexts

Inline formatting contexts do a variety of text transformations on their text content including white space collapsing, application of the text-transform CSS property, and application of the -webkit-text-security property. This module contains code to handle this as well as code to map from offsets in the original DOM node to the final IFC text and vice-versa.

Structsยง

CharacterTransformIteration
A single iteration in a pipeline of character iterators, that handle things like whitespace collapse and text-transform processing for text in an [InlineFormattingContext]. Each iteration can consume multiple characters and produce zero or more characters (up to 3). Consumption of characters greater than the characters produced by CharacterTransformIteration indicate that those characters have been collapsed.
OffsetMap
OffsetMapKnownPosition ๐Ÿ”’
TextTransformationIterator ๐Ÿ”’
WhitespaceCollapse

Constantsยง

MAX_CASE_MAPPING_LENGTH ๐Ÿ”’
https://github.com/rust-lang/rust/blob/1.97.1/library/core/src/char/mod.rs#L523

Staticsยง

IMPLICIT_KNOWN_POSITION_AT_START ๐Ÿ”’

Functionsยง

capitalization_iterator ๐Ÿ”’
Given an input iterator, a size hint for the number items in the iterator, and a boolean determining whether the start of the input represents a word boundary, return an iterator that capitalizes one-to-one mapped characters from the input iterator.
map_character_for_webkit_text_security ๐Ÿ”’
Map a character according to the rules of the -webkit-text-security CSS property.
map_characters_with_phf ๐Ÿ”’
simple_case_transform_iterator ๐Ÿ”’