The Magic of Chrome Some of the more technical readers might wonder what magic allows Firefox to use themes. After all, it is the Windows (or Linux or OS/X) interface, right? Wrong. It is Firefox's interface. Most applications are made up of hundreds of windows, arranged in a tree structure of parents, children, and siblings. A window might have a menu, toolbar, or other attached objects (such as scrollbars), but these smaller objects are actually windows, too. The application depends on Windows to manage these objects. So when you click a menu item, for example, Windows sends a message to the application's menu handler. Firefox, however, has none of the detail windows other applications have. Instead, Firefox creates the menu, toolbar, or other item by drawing them itself rather than having Windows do the management. Instead, Firefox determines which menu item was clicked and calls the handler itself. So, if Windows isn't providing the menus and toolbars, who is? Firefox is, using the Gecko rendering engine. This engine is the same engine that makes web pages appear in Firefox. It also creates the menus, toolbars, and other similar objects. Because Gecko understands Cascading Style Sheets (CSS), creating a theme is much easier. Why do this? Well, you'd think that using themes might be the entire answer, but it is not. In fact, Firefox does this so that it can be as platform independent as possible (although there are a few platform-dependent features in the Mozilla products). After all, were Firefox to use Windows support for this, how would you (easily) make it work on Linux or OS/X? |