Firefox (and other XUL Mozilla projects like Thunderbird) are organized
like so:
+-------------------------------------------------------+
| |
| USER INTERFACE (XUL + JS + CSS + C++) |
| |
+-------------------------------------------------------+
| USER INTERFACE TOOLKIT (XUL + JS + XBL + CSS + C++) |
+-------------------------------------------------------+
| |
| GECKO (RENDERING, DOM, JAVASCRIPT, NETWORKING) |
| (C++, C) |
| |
+-------------------------------------------------------+
User Interface layout is done using a XML language called XUL. It is scripted using JavaScript. Various user interface and application level features are implemented in JavaScript and C++.
The XUL toolkit is implemented partially in the Gecko rendering engine (for primitives like the flexible box model) and partially in XBL (an XML language for encapsulating pieces of UI and script into discrete components - basically build your own tags from other tags)
Gecko handles loading, parsing and displaying documents: both web pages and the user interface itself.
Mozilla uses XPCOM extensively to facilitate componentization and also as part of the means by which code in JavaScript can call through to C++ (and vice versa).
Almost all the code in Firefox and other XUL-based projects runs on all platforms. There are separations where special casing needs to happen for a specific platform, e.g. Windows Registry access, etc. This is rare in the user interface and often exists to work around bugs in the APIs exposed by the widget layer.
Underneath Gecko are several platform specific subsystems for creating native widgets for windows (called "widget"), rendering (called "gfx"), basic runtime infrastructure (called "nspr") etc. These systems expose platform independent APIs that the rest of the application use so that they don't have to write several copies of code for different platforms.
For more information about the Browser code, read Code Organization