Archive for June 13, 2008

Friday, June 13, 2008

Firefox 3 for Mac OS X: Under the Hood

Josh Aas:

The context menus, dropdown menus, the toolbar, the search bar, the buttons and text fields within Web pages—they are not actual Cocoa controls. For example, instead of using actual Cocoa buttons for “Submit” buttons we just draw the image of an Aqua “Submit” button into an NSView, one of the basic Cocoa objects we use. Gecko 1.9 has Aqua form controls because we now draw images of Aqua form controls when appropriate, not because we use actual Cocoa controls. The reason we don’t use actual Cocoa controls isn’t because we are lazy or we can’t figure out how to use them or because we are constrained by our cross-platform requirements—Apple’s WebKit doesn’t use actual Cocoa controls for things like “Submit” buttons or popup buttons in Web pages either, at least not the last time I checked.

Sure, but Firefox 3 also uses the fake controls throughout the application: the preferences window, the browser toolbar, the bookmarks editor, etc. Even without clicking on anything, it’s obvious that the interface was built using a cross-platform framework.

Update: Johan Sanneblad has screenshots of some of the differences (via John Gruber).