mozilla/gecko-dev
Editor
editor/ implements every editable surface in Firefox: text inputs, textareas, contenteditable, designMode, the rich-text widgets in browser chrome, and the spellchecker.
What's in the directory
editor/
├── libeditor/ # The editor implementations: TextEditor, HTMLEditor
├── txmgr/ # Transaction manager (undo/redo)
├── spellchecker/ # Spell checker + UI integration
├── composer/ # Higher-level (HTML editor) controller
├── reftests/, crashtests/
└── ...Key abstractions
| Type | File | Role |
|---|---|---|
EditorBase / TextEditor / HTMLEditor |
editor/libeditor/EditorBase.h |
The editor classes |
EditAction |
editor/libeditor/EditAction.h |
Fine-grained edit operations |
EditTransactionBase |
editor/libeditor/ |
Undoable transactions |
nsITransactionManager |
editor/txmgr/ |
Undo/redo stack |
mozInlineSpellChecker |
editor/spellchecker/ |
Spell-check pipeline |
What an "editor" is in Gecko
An editor is attached to:
- A
<textarea>or<input type=text>(viaTextEditor). - Any element with
contenteditable=true(viaHTMLEditor). - The whole document with
document.designMode = "on".
The editor processes IME composition events, paste/drop, drag, undo/redo, autocopy/autocut, formatting commands (document.execCommand), and synchronization with the selection.
Spell check
mozInlineSpellChecker watches text mutations, tokenizes against a dictionary (managed by Hunspell, vendored in extensions/spellcheck/hunspell/), and underlines misspellings.
Related
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.