Bug 1874683 - Part 10: Inline String.prototype.at in CacheIR. r=jandem
[gecko.git] / docs / contributing / directory_structure.rst
blobfd447278c2b409e40f28b8fd8280150cfa8e79e4
1 Firefox Source Code Directory Structure
2 =======================================
4 This article provides an overview of what the various directories contain.
6 To simply take a look at the Firefox source code, you do not need to
7 download it. You can look at the source directly with your web browser
8 using Searchfox (start at https://searchfox.org/mozilla-central/source for
9 the complete firefox source code of branch HEAD).
11 In order to modify the source, you have to acquire it either by
12 downloading a :ref:`snapshot <Mercurial Overview>` of the sources or
13 by checking out the current sources from
14 :ref:`the repository <Firefox Contributors' Quick Reference>`.
16 This document describes the directory structure -- i.e., directories that
17 are used by at least some of the
18 Mozilla project's client products. There are other directories in the
19 other Mozilla repository, such as those for Web tools and those for the
20 Classic codebase.
22 See the `more detailed overview of the pieces of Gecko <https://wiki.mozilla.org/Gecko:Overview>`__.
24 .cargo
25 ------
27 Configuration files for the `Cargo package
28 manager <https://crates.io/>`__.
30 .vscode
31 -------
33 Configuration files used by the `Visual Studio Code
34 IDE <https://code.visualstudio.com/>`__ when working in the
35 mozilla-central tree.
37 accessible
38 ----------
40 Files for accessibility (i.e., MSAA (Microsoft Active Accessibility),
41 ATK (Accessibility Toolkit, used by GTK) support files). See
42 `Accessibility <https://developer.mozilla.org/docs/Web/Accessibility>`__.
45 browser
46 -------
48 Contains the front end code (in XUL, Javascript, XBL, and C++) for the
49 Firefox desktop browser. Many of these files started off as a copy of files in
50 `xpfe <#xpfe>`__.
52 browser/extensions
53 ------------------
55 Contains `PDF.js <https://mozilla.github.io/pdf.js/>`__ and
56 `WebCompat <https://github.com/mozilla/webcompat-addon>`__ built-in extensions.
58 browser/themes
59 --------------
61 Contains images and CSS files to skin the browser for each OS (Linux,
62 Mac and Windows)
64 build
65 -----
67 Miscellaneous files used by the build process. See also `config <#config>`__.
69 caps
70 ----
72 Capability-based web page security management. It contains C++ interfaces
73 and code for determining the capabilities of content based on the
74 security settings or certificates (e.g., VeriSign). See `Component
75 Security <https://www.mozilla.org/projects/security/components/>`__ .
77 chrome
78 ------
80 :ref:`Chrome registry <Chrome Registration>` used with `toolkit <#toolkit>`__/.
81 These files were originally copies of files in `rdf/chrome/`.
83 config
84 ------
86 More files used by the build process, common includes for the makefiles,
87 etc.
90 devtools
91 --------
93 The Firefox Developer Tools server and client components. See :ref:`contributor <devtools-contributor-doc>` and :ref:`user <devtools-user-doc>` documentation.
96 docs
97 ----
99 Contains the documentation configuration (`Sphinx <http://www.sphinx-doc.org/>`__ based), the index page
100 and the contribution pages.
103 docshell
104 --------
106 Implementation of the docshell, the main object managing things related
107 to a document window. Each frame has its own docshell. It contains
108 methods for loading URIs, managing URI content listeners, etc. It is the
109 outermost layer of the embedding API used to embed a Gecko browser into
110 an application.
115 -  :ref:`IDL definitions <XPIDL>` of the interfaces defined by
116    the DOM specifications and Mozilla extensions to those interfaces
117    (implementations of these interfaces are primarily, but not
118    completely, in `content <#content>`__).
119 -  The parts of the connection between JavaScript and the
120    implementations of DOM objects that are specific both to JavaScript
121    and to the DOM.
122 -  Implementations of a few of the core "DOM Level 0" objects, such as
123    `window <https://developer.mozilla.org/docs/Web/API/Window>`__ , `window.navigator <https://developer.mozilla.org/docs/Web/API/Window/navigator>`__, `window.location <https://developer.mozilla.org/docs/Web/API/Window/location>`__, etc.
125 editor
126 ------
128 The editor directory contains XUL/Javascript for the embeddable editor
129 component, which is used for the HTML Editor("Composer"), for plain and
130 HTML mail composition, and for text fields and text areas throughout the
131 product. The editor is designed like a
132 "browser window with editing features": it adds some special classes for
133 editing text and managing transaction undo/redo, but reuses browser code
134 for nearly everything else.
136 extensions
137 ----------
139 Contains several extensions to mozilla, which can be enabled at
140 compile-time using the ``--enable-extensions`` configure argument.
142 Note that some of these are now built specially and not using the
143 ``--enable-extensions`` option. For example, disabling xmlextras is done
144 using ``--disable-xmlextras``.
147 extensions/auth
148 ---------------
150 Implementation of the negotiate auth method for HTTP and other
151 protocols. Has code for SSPI, GSSAPI, etc. See `Integrated
152 Authentication <https://www.mozilla.org/projects/netlib/integrated-auth.html>`__.
155 extensions/pref
156 ---------------
158 Preference-related extensions.
160 extensions/spellcheck
161 ---------------------
163 Spellchecker for mailnews and composer.
165 extensions/universalchardet
166 ---------------------------
168 Detects the character encoding of text.
173 Contains interfaces that abstract the capabilities of platform specific
174 graphics toolkits, along with implementations on various platforms.
175 These interfaces provide methods for things like drawing images, text,
176 and basic shapes. It also contains basic data structures such as points
177 and rectangles used here and in other parts of Mozilla.
179 gradle
180 ------
182 Containing files related to a Java build system.
187 Contains platform specified functions (e.g. obtaining battery status,
188 sensor information, memory information, Android
189 alarms/vibrate/notifications/orientation, etc)
191 image
192 -----
194 Image rendering library. Contains decoders for the image formats Firefox
195 supports.
197 intl
198 ----
200 Internationalization and localization support. See
201 `L10n:NewProjects <https://wiki.mozilla.org/L10n:NewProjects>`__.
203 intl/locale
204 -----------
206 Code related to determination of locale information from the operating
207 environment.
209 intl/lwbrk
210 ----------
212 Code related to line breaking and word breaking.
214 intl/strres
215 -----------
217 Code related to string resources used for localization.
219 intl/uconv
220 ----------
222 Code that converts (both ways: encoders and decoders) between UTF-16 and
223 many other character encodings.
225 intl/unicharutil
226 ----------------
228 Code related to implementation of various algorithms for Unicode text,
229 such as case conversion.
234 Container for implementations of IPC (Inter-Process Communication).
236 js/src
237 ------
239 The JavaScript engine, also known as
240 :ref:`SpiderMonkey <SpiderMonkey>`.
241 See also `JavaScript <https://developer.mozilla.org/docs/JavaScript>`__.
243 js/xpconnect
244 ------------
246 Support code for calling JavaScript code from C++ code and C++ code from
247 JavaScript code, using XPCOM interfaces. See
248 `XPConnect <https://developer.mozilla.org/docs/XPConnect>`__.
250 layout
251 ------
253 Code that implements a tree of rendering objects that describe the types
254 and locations of the objects that are displayed on the screen (such as
255 CSS boxes, tables, form controls, XUL boxes, etc.), and code that
256 manages operations over that rendering tree (such as creating and
257 destroying it, doing layout, painting, and event handling). See
258 `documentation <https://www.mozilla.org/newlayout/doc/>`__ and `other
259 information <https://www.mozilla.org/newlayout/>`__.
261 layout/base
262 -----------
264 Code that deals with the rendering tree.
266 layout/forms
267 ------------
269 Rendering tree objects for HTML form controls.
271 layout/generic
272 --------------
274 The basic rendering object interface and the rendering tree objects for
275 basic CSS boxes.
277 layout/mathml
278 -------------
280 Rendering tree objects for `MathML <https://developer.mozilla.org/docs/Web/MathML>`__.
282 layout/svg
283 ----------
285 Rendering tree objects for `SVG <https://developer.mozilla.org/docs/Web/SVG>`__.
287 layout/tables
288 -------------
290 Rendering tree objects for CSS/HTML tables.
292 layout/xul
293 ----------
295 Additional rendering object interfaces for `XUL <https://developer.mozilla.org/docs/XUL>`__ and
296 the rendering tree objects for XUL boxes.
298 media
299 -----
301 Contains sources of used media libraries for example *libpng*.
303 memory
304 ------
306 Cross-platform wrappers for *memallocs* functions etc.
308 mfbt
309 ----
311 Implementations of classes like *WeakPtr*. Multi-platform *assertions*
312 etc.
314 mobile
315 ------
317 mobile/android
318 --------------
320 Firefox for Android and Geckoview
322 modules
323 -------
325 Compression/Archiving, math library, font (and font compression),
326 Preferences Library
328 modules/libjar
329 --------------
331 Code to read zip files, used for reading the .jar files that contain the
332 files for the mozilla frontend.
334 modules/libpref
335 ---------------
337 Library for reading and writing preferences.
339 modules/zlib
340 ------------
342 Source code of zlib, used at least in the networking library for
343 compressed transfers.
345 mozglue
346 -------
348 Glue library containing various low-level functionality, including a
349 dynamic linker for Android, a DLL block list for Windows, etc.
351 netwerk
352 -------
354 :ref:`Networking library <Networking>`, also known as Necko.
355 Responsible for doing actual transfers from and to servers, as well as
356 for URI handling and related stuff.
358 netwerk/cookie
359 --------------
361 Permissions backend for cookies, images, etc., as well as the user
362 interface to these permissions and other cookie features.
364 nsprpub
365 -------
367 Netscape Portable Runtime. Used as an abstraction layer to things like
368 threads, file I/O, and socket I/O. See :ref:`NSPR`.
370 nsprpub/lib
371 -----------
373 Mostly unused; might be used on Mac?
375 other-licenses
376 --------------
378 Contains libraries that are not covered by the MPL but are used in some
379 Firefox code.
381 parser
382 ------
384 Group of structures and functions needed to parse files based on
385 XML/HTML.
387 parser/expat
388 ------------
390 Copy of the expat source code, which is the XML parser used by mozilla.
392 parser/html
393 -----------
395 The HTML parser (for everything except about:blank).
397 parser/htmlparser
398 -----------------
400 The legacy HTML parser that's still used for about:blank. Parts of it
401 are also used for managing the conversion of the network bytestream into
402 Unicode in the XML parsing case.
404 parser/xml
405 ----------
407 The code for integrating expat (from parser/expat) into Gecko.
409 python
410 ------
412 Cross module python code.
414 python/mach
415 -----------
417 The code for the :ref:`Mach` building tool.
419 security
420 --------
422 Contains NSS and PSM, to support cryptographic functions in mozilla
423 (like S/MIME, SSL, etc). See :ref:`Network Security Services (NSS)`
425 `Personal Security Manager
426 (PSM) <https://www.mozilla.org/projects/security/pki/psm/>`__.
428 services
429 --------
431 Firefox accounts and sync (history, preferences, tabs, bookmarks,
432 telemetry, startup time, which addons are installed, etc). See
433 `here <https://docs.services.mozilla.com/>`__.
435 servo
436 -----
438 `Servo <https://servo.org/>`__, the parallel browser engine project.
440 startupcache
441 ------------
443 XXX this needs a description.
445 storage
446 -------
448 `Storage <https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Storage>`__: XPCOM wrapper for sqlite. Wants to
449 unify storage of all profile-related data. Supersedes mork. See also
450 `Unified Storage <https://wiki.mozilla.org/Mozilla2:Unified_Storage>`__.
452 taskcluster
453 -----------
455 Scripts and code to automatically build and test Mozilla trees for the
456 continuous integration and release process.
458 testing
459 -------
461 Common testing tools for mozilla codebase projects, test suite
462 definitions for automated test runs, tests that don't fit anywhere else,
463 and other fun stuff.
465 third_party
466 -----------
468 Vendored dependencies maintained outside of Mozilla.
470 toolkit
471 -------
473 The "new toolkit" used by Thunderbird, Firefox, etc. This contains
474 numerous front-end components shared between applications as well as
475 most of the XBL-implemented parts of the XUL language (most of which was
476 originally forked from versions in `xpfe/`).
478 toolkit/mozapps/extensions/test/xpinstall
479 -----------------------------------------
481 The installer, which contains code for installing Mozilla and for
482 installing XPIs/extensions. This directory also contains code needed to
483 build installer packages. See `XPInstall <https://developer.mozilla.org/docs/XPInstall>`__ and
484 the `XPInstall project
485 page <https://www.mozilla.org/projects/xpinstall/>`__.
487 tools
488 -----
490 Some tools which are optionally built during the mozilla build process.
492 tools/lint
493 ----------
495 The linter declarations and configurations.
496 See `linting documentation </code-quality/lint/>`_
498 uriloader
499 ---------
501 uriloader/base
502 --------------
504 Content dispatch in Mozilla. Used to load uris and find an appropriate
505 content listener for the data. Also manages web progress notifications.
506 See `Document Loading: From Load Start to Finding a
507 Handler <https://www.mozilla.org/docs/docshell/uri-load-start.html>`__
508 and `The Life Of An HTML HTTP
509 Request <https://www.mozilla.org/docs/url_load.html>`__.
512 uriloader/exthandler
513 --------------------
515 Used to handle content that Mozilla can't handle itself. Responsible for
516 showing the helper app dialog, and generally for finding information
517 about helper applications.
519 uriloader/prefetch
520 ------------------
522 Service to prefetch documents in order to have them cached for faster
523 loading.
525 view
526 ----
528 View manager. Contains cross-platform code used for painting, scrolling,
529 event handling, z-ordering, and opacity. Soon to become obsolete,
530 gradually.
532 widget
533 ------
535 A cross-platform API, with implementations on each platform, for dealing
536 with operating system/environment widgets, i.e., code related to
537 creation and handling of windows, popups, and other native widgets and
538 to converting the system's messages related to painting and events into
539 the messages used by other parts of Mozilla (e.g., `view/` and
540 `content/`, the latter of which converts many of the
541 messages to yet another API, the DOM event API).
543 xpcom
544 -----
546 `Cross-Platform Component Object Model </en-US/docs/XPCOM>`__. Also
547 contains data structures used by the rest of the mozilla code. See also
548 `XPCOM Project <https://www.mozilla.org/projects/xpcom/>`__.
550 xpfe
551 ----
553 XPFE (Cross Platform Front End) is the SeaMonkey frontend. It contains
554 the XUL files for the browser interface, common files used by the other
555 parts of the mozilla suite, and the XBL files for the parts of the XUL
556 language that are implemented in XBL. Much of this code has been copied
557 to `browser/` and `toolkit/` for use in
558 Firefox, Thunderbird, etc.
561 xpfe/components
562 ---------------
564 Components used by the Mozilla frontend, as well as implementations of
565 interfaces that other parts of mozilla expect.