Overview
Complement Editor → Accessibility. For typical hybrid editors, WASM handles data; the view must expose correct roles, names, and focus moves for keyboard and AT users.
Browser as host surface
With contenteditable, assistive tech interacts with the
same DOM you mutate from JS. If Rust drives all structure via
patches, ensure updates preserve stable landmarks
(headings, lists) where possible.
Roles & labels
Toolbar buttons need labels; the editable region may need aria-multiline, instructions, or live regions for
collaboration status—policy belongs in the UI layer even if copy
comes from WASM.
Focus management
Custom toolbars and modals must not steal focus without restoring the caret; WASM callbacks that trigger re-renders should be sequenced so focus is not lost mid-IME session.
Canvas-only editors need explicit accessibility mappings (e.g. separate off-screen input or ARIA canvas patterns)—much heavier than DOM-hosted editing.
What WASM does not fix
Screen reader behavior for complex widgets is still dominated by browser and AT heuristics. Test with VoiceOver, NVDA, and mobile TalkBack on real devices.
Wasm guides
Editing approaches
contenteditable + WASM: source of truth, event order, DOM↔model loop, normalization, and when to call Rust.
IME & composition
composition events, syncing a Rust document model, and why the browser still owns the IME.
JS ↔ WASM boundary
Strings, copies, batched ops, async vs input events, and keeping the hot path cheap.
Clipboard & input routing
beforeinput, paste, routing decisions in JS vs sanitization in WASM.
Tooling, bundle & workers
wasm-pack, wasm-opt, code splitting, Web Workers, COOP/COEP and threads.
Collaboration & CRDT (WASM)
Yrs/y-crdt, bridging to Yjs, snapshots vs update streams with an editor host.
Selection, Range & offsets
UTF-16 vs UTF-8 indices, Selection/Range in JS, mapping to a Rust model and getTargetRanges.
Undo & redo model
Browser undo stack vs model history, programmatic DOM, and WASM-hosted transactions.
Testing & debugging
E2E, profiling the JS↔WASM boundary, reproducing IME and paste in CI.
Security & deployment
CSP, SRI, module integrity, and hosting WASM next to contenteditable.