Mozilla Editor



What is the editor?

The Mozilla editor provides HTML and plain text editing functionality in Gecko-based applications. Internally, the editor code manipulates page content primarily using DOM calls, so it is a true DOM-savvy editor. It also supports IME (international text input), and is mostly accessible from JavaScript.

The editor is currently used in three different ways in the Mozilla codebase, though each application shares the same underlying code:

  1. Composer -- a fully-fledged HTML editor, for writing web pages.
  2. Embeddable HTML editing widet -- a rich text editing tool, used in mail compose, instant messaging and other areas.
  3. Text widget -- the editor is used for text input and text areas, both in XUL (e.g. the URL bar), and in HTML form controls.

See the developer docs below for more information about how the editor works.

The editor code lives in mozilla/editor/, though we also rely on (and in some cases support) code in other areas, particularly DOM range and selection (DOM interfaces, range and selection implementation). We also maintain the output system: code to convert a DOM document to some form of text (to plain text, or HTML).

Editor code is currently packaged into 3 XPCOM component DLLs:

Library DLL name* Purpose
Win32 Unix Mac
Editor editor.dll libeditor.so EditorCore.shlb Core editing functionality, interfaces with JS
Transaction Manager txmgr.dll libtxmgr.so EditorTxmgr.shlb Generic transaction handling (for undo/redo support)
Text Services txtsvc.dll libtxtsvc.so TextServices.shlb Provides simple interface to get text from a DOM document (for Find and Spellcheck)

*note that names in debug builds may be different.

Editor user-interface files, consisting of XUL, JS, CSS and GIF files for the editor window and dialogs live in mozilla/editor/ui/, and, in a build, get installed to chrome/packages/core/editor/content/ and chrome/skins//editor/skin/.


Editor documentation

Please feel free to comment on these documents in the editor newsgroup/mailing list; see the community page for details on how to subscribe.

Note: inevitably, as development progresses, some of these documents will become out of date. Before embarking on any non-trivial task based on information presented here, contact the editor group for the latest details.

Brian King has also written some documents about extending the editor, at the O'Reilly DevCenter.

Behavior specs

These spec documents describe the way we'd like the editor to behave in response to various user-level actions, given the current editing context and possible preference or other settings. They deal with issues like "What happens if my selection point is in a paragraph, and I type 'return'?"

UI specs

These specs deal with parts of the UI such as the main window, dialogs, menus, context menus etc.

Implementation specs

Some specs concerning lower-level details of specific areas in the editor.

Test plans

Test plans and testcase used by QA (Quality Assurance) to determine whether features work (i.e. to look for bugs).


Developer information

The following documents are intended mainly for a developer audience, and get down to the nitty-gritty about how the editor works.

Some more generic "how-to" documents


Historical information

As with the rest of the layout codebase, the current editor is based on entirely new source, on top of the Gecko layout engine. There are no parts of the old, 4.x-derived composer codebase that remain.

Information about the old Composer is available; be warned that this code is no longer being developed or maintained, but is still in the tree for those who might want to reference it.


How can I help?

So you want to jump in and hack some code, tweak the UI, or write docs or test plans? Excellent!

The first thing to do is to decide how you'd like to contribute. We'd be very glad to have assistance in any of the following areas, so let me list them, and say what kind of level of expertise would be required for each one:


Who are we?

(remove any spaces and replace AT with @ and dot with .)

If you want to know who to contact for a particular problem or code area, this table is your best resource.


How to reach us

The newsgroup for discussing Mozilla editor issues is netscape.public.mozilla.editor, and members of the editor team regularly read and post to that newsgroup. It is gatewayed into the mailing list mozilla-editor; subscribe here (put "subscribe" as the subject of the message).