Open-Source Wikis

/

Gecko

/

Systems

/

Editor

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> (via TextEditor).
  • Any element with contenteditable=true (via HTMLEditor).
  • 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.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Editor – Gecko wiki | Factory