AUDIO
Source snapshot · 11 November 2026

Browser text editing

Source and selection

maximumBytes is an integer from 1 through 4096; history is an integer from 0 through 64, shared across undo and redo snapshots. Defaults are 4096 and 64. Committed source is valid Unicode scalar text with LF newlines. CR, other C0/C1 controls, Unicode noncharacters and lone UTF-16 surrogates reject without replacing surrogates with U+FFFD. Browser textarea normalization can already have converted CR or CRLF to LF before construction or native input; programmatic source containing CR rejects. The helper validates the actual native DOM value before publishing it. Native preedit, browser internal history, layout and operating-system work remain opaque; the committed-source limits do not bound that transient work or establish a real-time deadline.

Selections are {anchor, focus} UTF-8 byte offsets at extended grapheme boundaries, with direction retained. Conversion to native UTF-16 offsets is explicit; byte offsets inside a scalar or grapheme reject. A native collapsed caret inside a grapheme advances to its end. A native range expands its start backward and end forward to complete graphemes, then restores that legal range in the field. Insertion that joins combining marks or emoji moves its caret to the next complete grapheme. Intl.Segmenter in the textarea's own window supplies boundaries. Its Unicode data depends on the browser, and can differ from the Rust buffer's Unicode 17 data. No caret affinity or shaped-ligature position is carried by this frontend.