AUDIO
Source snapshot · 11 November 2026

Browser text editing

Composition and consumer bridges

Composition retains the committed baseline while the browser displays preedit. Programmatic writes and history reject Busy throughout composition and its pending finalization. One next-task timer coalesces a trailing input after compositionend into one validated source edit and one history snapshot. Invalid or oversized commits restore the baseline. Blur, disabling/hiding, removal and disposal cancel pending ownership; no queue of programmatic updates is retained. Native noncancelable history likewise allows one pending transaction until its input or cancellation. Actual platform IME event order requires consumer validation.

A notification does not mean Rust accepted the source. A consumer bridge must own a specific Rust document and current Rust revision, assign a separate bounded request identifier, and retain the local JavaScript revision associated with that request. Validate LF policy, UTF-8 ranges, browser/Rust grapheme differences and source limits on the receiving side. Acknowledge or reject explicitly. Apply a returned committed snapshot quietly only if its associated local token still matches; an older response must not overwrite newer editing. Resynchronize deliberately after conflict, and retry after composition ends rather than queuing unbounded updates. This helper provides no transport, Rust-token serialization, distributed undo or acknowledgement protocol.