Bug 669028 part.15 Remove nsILookAndFeel r=roc, sr=matspal
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 09 Sep 2011 11:27:13 +0900
changeset 78132 fd52770098cae65b41c037ba6c5b9d136f95b22c
parent 78131 4a5d378339d95a1507fb498c69bd0caf265c8c50
child 78133 68b5bfaebb24e31f6c52bb4b2660c814eba09ac3
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, matspal
bugs669028
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 669028 part.15 Remove nsILookAndFeel r=roc, sr=matspal
widget/public/LookAndFeel.h
widget/public/nsWidgetsCID.h
widget/src/android/nsLookAndFeel.cpp
widget/src/android/nsLookAndFeel.h
widget/src/android/nsWidgetFactory.cpp
widget/src/build/nsWinWidgetFactory.cpp
widget/src/cocoa/nsLookAndFeel.h
widget/src/cocoa/nsLookAndFeel.mm
widget/src/cocoa/nsWidgetFactory.mm
widget/src/gtk2/nsLookAndFeel.cpp
widget/src/gtk2/nsLookAndFeel.h
widget/src/gtk2/nsWidgetFactory.cpp
widget/src/os2/nsLookAndFeel.cpp
widget/src/os2/nsLookAndFeel.h
widget/src/os2/nsWidgetFactory.cpp
widget/src/qt/nsLookAndFeel.cpp
widget/src/qt/nsLookAndFeel.h
widget/src/qt/nsWidgetFactory.cpp
widget/src/windows/nsLookAndFeel.cpp
widget/src/windows/nsLookAndFeel.h
widget/src/xpwidgets/nsXPLookAndFeel.cpp
widget/src/xpwidgets/nsXPLookAndFeel.h
--- a/widget/public/LookAndFeel.h
+++ b/widget/public/LookAndFeel.h
@@ -37,395 +37,22 @@
 
 #ifndef __LookAndFeel
 #define __LookAndFeel
 
 #ifndef MOZILLA_INTERNAL_API
 #error "This header is only usable from within libxul (MOZILLA_INTERNAL_API)."
 #endif
 
-#include "nsISupports.h"
+#include "nsDebug.h"
 #include "nsColor.h"
 
-  // for |#ifdef NS_DEBUG|
+// for |#ifdef NS_DEBUG|
 struct nsSize;
 
-// 89401022-94b3-413e-a6b8-2203dab824f3
-#define NS_ILOOKANDFEEL_IID \
-{ 0x89401022, 0x94b3, 0x413e, \
-  { 0xa6, 0xb8, 0x22, 0x03, 0xda, 0xb8, 0x24, 0xf3 } }
-
-class nsILookAndFeel: public nsISupports {
-public:
-    NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILOOKANDFEEL_IID)
-
-  // When modifying this list, also modify nsXPLookAndFeel::sColorPrefs
-  // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
-  typedef enum {
-
-    // WARNING : NO NEGATIVE VALUE IN THIS ENUMERATION
-    // see patch in bug 57757 for more information
-
-    eColor_WindowBackground,
-    eColor_WindowForeground,
-    eColor_WidgetBackground,
-    eColor_WidgetForeground,
-    eColor_WidgetSelectBackground,
-    eColor_WidgetSelectForeground,
-    eColor_Widget3DHighlight,
-    eColor_Widget3DShadow,
-    eColor_TextBackground,
-    eColor_TextForeground,
-    eColor_TextSelectBackground,
-    eColor_TextSelectForeground,
-    eColor_TextSelectBackgroundDisabled,
-    eColor_TextSelectBackgroundAttention,
-    eColor_TextHighlightBackground,
-    eColor_TextHighlightForeground,
-
-    eColor_IMERawInputBackground,
-    eColor_IMERawInputForeground,
-    eColor_IMERawInputUnderline,
-    eColor_IMESelectedRawTextBackground,
-    eColor_IMESelectedRawTextForeground,
-    eColor_IMESelectedRawTextUnderline,
-    eColor_IMEConvertedTextBackground,
-    eColor_IMEConvertedTextForeground,
-    eColor_IMEConvertedTextUnderline,
-    eColor_IMESelectedConvertedTextBackground,
-    eColor_IMESelectedConvertedTextForeground,
-    eColor_IMESelectedConvertedTextUnderline,
-
-    eColor_SpellCheckerUnderline,
-
-    // New CSS 2 color definitions
-    eColor_activeborder,
-    eColor_activecaption,
-    eColor_appworkspace,
-    eColor_background,
-    eColor_buttonface,
-    eColor_buttonhighlight,
-    eColor_buttonshadow,
-    eColor_buttontext,
-    eColor_captiontext,
-    eColor_graytext,
-    eColor_highlight,
-    eColor_highlighttext,
-    eColor_inactiveborder,
-    eColor_inactivecaption,
-    eColor_inactivecaptiontext,
-    eColor_infobackground,
-    eColor_infotext,
-    eColor_menu,
-    eColor_menutext,
-    eColor_scrollbar,
-    eColor_threeddarkshadow,
-    eColor_threedface,
-    eColor_threedhighlight,
-    eColor_threedlightshadow,
-    eColor_threedshadow,
-    eColor_window,
-    eColor_windowframe,
-    eColor_windowtext,
-
-    eColor__moz_buttondefault,
-    // Colors which will hopefully become CSS3
-    eColor__moz_field,
-    eColor__moz_fieldtext,
-    eColor__moz_dialog,
-    eColor__moz_dialogtext,
-    eColor__moz_dragtargetzone,				//used to highlight valid regions to drop something onto
-
-    eColor__moz_cellhighlight,                               //used to cell text background, selected but not focus
-    eColor__moz_cellhighlighttext,                           //used to cell text, selected but not focus
-    eColor__moz_html_cellhighlight,                          //used to html select cell text background, selected but not focus
-    eColor__moz_html_cellhighlighttext,                      //used to html select cell text, selected but not focus
-    eColor__moz_buttonhoverface,                             //used to button text background, when mouse is over
-    eColor__moz_buttonhovertext,                             //used to button text, when mouse is over
-    eColor__moz_menuhover,                                   //used to menu item background, when mouse is over
-    eColor__moz_menuhovertext,                               //used to menu item text, when mouse is over
-    eColor__moz_menubartext,                                 //used to menu bar item text
-    eColor__moz_menubarhovertext,                            //used to menu bar item text, when mouse is over
-    // On platforms where these colors are the same as
-    // -moz-field, use -moz-fieldtext as foreground color
-    eColor__moz_eventreerow,
-    eColor__moz_oddtreerow,
-
-    // colors needed by the Mac OS X theme
-    eColor__moz_mac_chrome_active,                          // background color of chrome toolbars in active windows
-    eColor__moz_mac_chrome_inactive,                        // background color of chrome toolbars in inactive windows
-    eColor__moz_mac_focusring,				//ring around text fields and lists
-    eColor__moz_mac_menuselect,				//colour used when mouse is over a menu item
-    eColor__moz_mac_menushadow,				//colour used to do shadows on menu items
-    eColor__moz_mac_menutextdisable,                    // color used to display text for disabled menu items
-    eColor__moz_mac_menutextselect,			//colour used to display text while mouse is over a menu item
-    eColor__moz_mac_disabledtoolbartext,                    // text color of disabled text on toolbars
-
-    //new in 10.2
-    eColor__moz_mac_alternateprimaryhighlight, //active list highlight
-    eColor__moz_mac_secondaryhighlight,        //inactive light hightlight
-
-    // vista rebars
-    eColor__moz_win_mediatext,                     // media rebar text
-    eColor__moz_win_communicationstext,            // communications rebar text
-
-    // Hyperlink color extracted from the system, not affected by the browser.anchor_color user pref.
-    // There is no OS-specified safe background color for this text, 
-    // but it is used regularly within Windows and the Gnome DE on Dialog and Window colors.
-    eColor__moz_nativehyperlinktext,
-
-    // Combo box widgets
-    eColor__moz_comboboxtext,
-    eColor__moz_combobox,
-
-    // keep this one last, please
-    eColor_LAST_COLOR
-  } nsColorID;
-
-  // When modifying this list, also modify nsXPLookAndFeel::sIntPrefs
-  // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
-  typedef enum {
-    eMetric_CaretBlinkTime,                               // default, may be overriden by OS
-    eMetric_CaretWidth,                                   // pixel width of caret
-    eMetric_ShowCaretDuringSelection,                       // show the caret when text is selected?
-    eMetric_SelectTextfieldsOnKeyFocus,                   // select textfields when focused via tab/accesskey?
-    eMetric_SubmenuDelay,                                 // delay before submenus open
-    eMetric_MenusCanOverlapOSBar,                         // can popups overlap menu/task bar?
-    eMetric_ScrollbarsCanOverlapContent,                  // can scrollbars float above content?
-    eMetric_SkipNavigatingDisabledMenuItem,               // skip navigating to disabled menu item?
-    eMetric_DragThresholdX,                               // begin a drag if the mouse is moved further than the threshold while the button is down
-    eMetric_DragThresholdY,
-    eMetric_UseAccessibilityTheme,                        // Accessibility theme being used?
-
-    eMetric_ScrollArrowStyle,                             // position of scroll arrows in a scrollbar
-    eMetric_ScrollSliderStyle,                            // is scroll thumb proportional or fixed?
-
-    eMetric_ScrollButtonLeftMouseButtonAction,            // each button can take one of four values:
-    eMetric_ScrollButtonMiddleMouseButtonAction,          // 0 - scrolls one  line, 1 - scrolls one page
-    eMetric_ScrollButtonRightMouseButtonAction,           // 2 - scrolls to end, 3 - button ignored
- 
-    eMetric_TreeOpenDelay,                                // delay for opening spring loaded folders
-    eMetric_TreeCloseDelay,                               // delay for closing spring loaded folders
-    eMetric_TreeLazyScrollDelay,                          // delay for triggering the tree scrolling
-    eMetric_TreeScrollDelay,                              // delay for scrolling the tree
-    eMetric_TreeScrollLinesMax,                           // the maximum number of lines to be scrolled at ones
-    eMetric_TabFocusModel,                                // What type of tab-order to use
-    eMetric_ChosenMenuItemsShouldBlink,                   // Should menu items blink when they're chosen?
-
-    /*
-     * A Boolean value to determine whether the Windows default theme is
-     * being used.
-     *
-     * The value of this metric is not used on other platforms. These platforms
-     * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
-     */
-    eMetric_WindowsDefaultTheme,
-
-    /*
-     * A Boolean value to determine whether the DWM compositor is being used
-     *
-     * This metric is not used on non-Windows platforms. These platforms
-     * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
-     */
-    eMetric_DWMCompositor,
-
-    /*
-     * A Boolean value to determine whether Windows is themed (Classic vs.
-     * uxtheme)
-     *
-     * This is Windows-specific and is not implemented on other platforms
-     * (will return the default of NS_ERROR_FAILURE).
-     */
-    eMetric_WindowsClassic,
-
-    /*
-     * A Boolean value to determine whether the device is a touch enabled
-     * device. Currently this is only supported by the Windows 7 Touch API.
-     *
-     * Platforms that do not support this metric should return
-     * NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
-     */
-    eMetric_TouchEnabled,
-
-    /*
-     * A Boolean value to determine whether the Mac graphite theme is
-     * being used.
-     *
-     * The value of this metric is not used on other platforms. These platforms
-     * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
-     */
-    eMetric_MacGraphiteTheme,
-
-    /*
-     * A Boolean value to determine whether the Mac OS X Lion-specific theming
-     * should be used.
-     *
-     * The value of this metric is not used on non-Mac platforms. These
-     * platforms should return NS_ERROR_NOT_IMPLEMENTED when queried for this
-     * metric.
-     */
-    eMetric_MacLionTheme,
-
-    /*
-     * A Boolean value to determine whether Mameo is using the new Fremantle
-     * theme.
-     *
-     * The value of this metric is not used on other platforms. These platforms
-     * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
-     */
-    eMetric_MaemoClassic,
-
-    /*
-     * eMetric_AlertNotificationOrigin indicates from which corner of the
-     * screen alerts slide in, and from which direction (horizontal/vertical).
-     * 0, the default, represents bottom right, sliding vertically.
-     * Use any bitwise combination of the following constants:
-     * NS_ALERT_HORIZONTAL (1), NS_ALERT_LEFT (2), NS_ALERT_TOP (4).
-     *
-     *       6       4
-     *     +-----------+
-     *    7|           |5
-     *     |           |
-     *    3|           |1
-     *     +-----------+
-     *       2       0
-     */
-    eMetric_AlertNotificationOrigin,
-
-    /**
-     * If true, clicking on a scrollbar (not as in dragging the thumb) defaults
-     * to scrolling the view corresponding to the clicked point. Otherwise, we
-     * only do so if the scrollbar is clicked using the middle mouse button or
-     * if shift is pressed when the scrollbar is clicked.
-     */
-    eMetric_ScrollToClick,
-
-    /**
-     * IME and spell checker underline styles, the values should be
-     * NS_DECORATION_LINE_STYLE_*.  They are defined below.
-     */
-    eMetric_IMERawInputUnderlineStyle,
-    eMetric_IMESelectedRawTextUnderlineStyle,
-    eMetric_IMEConvertedTextUnderlineStyle,
-    eMetric_IMESelectedConvertedTextUnderline,
-    eMetric_SpellCheckerUnderlineStyle,
-
-    /**
-     * If this metric != 0, show icons in menus.
-     */
-    eMetric_ImagesInMenus,
-    /**
-     * If this metric != 0, show icons in buttons.
-     */
-    eMetric_ImagesInButtons,
-    /**
-     * If this metric != 0, support window dragging on the menubar.
-     */
-    eMetric_MenuBarDrag,
-    /**
-     * Return the appropriate WindowsThemeIdentifier for the current theme.
-     */
-    eMetric_WindowsThemeIdentifier
-  } nsMetricID;
-
-  /**
-   * Windows themes we currently detect.
-   */
-  enum WindowsThemeIdentifier {
-    eWindowsTheme_Generic = 0, // unrecognized theme
-    eWindowsTheme_Classic,
-    eWindowsTheme_Aero,
-    eWindowsTheme_LunaBlue,
-    eWindowsTheme_LunaOlive,
-    eWindowsTheme_LunaSilver,
-    eWindowsTheme_Royale,
-    eWindowsTheme_Zune
-  };
-
-  enum {
-    eMetric_ScrollArrowNone = 0,
-    eMetric_ScrollArrowStartBackward = 0x1000,
-    eMetric_ScrollArrowStartForward = 0x0100,
-    eMetric_ScrollArrowEndBackward = 0x0010,
-    eMetric_ScrollArrowEndForward = 0x0001,
-    eMetric_ScrollArrowStyleSingle =                      // single arrow at each end
-      eMetric_ScrollArrowStartBackward|eMetric_ScrollArrowEndForward, 
-    eMetric_ScrollArrowStyleBothAtBottom =                // both arrows at bottom/right, none at top/left
-      eMetric_ScrollArrowEndBackward|eMetric_ScrollArrowEndForward,
-    eMetric_ScrollArrowStyleBothAtEachEnd =               // both arrows at both ends
-      eMetric_ScrollArrowEndBackward|eMetric_ScrollArrowEndForward|
-      eMetric_ScrollArrowStartBackward|eMetric_ScrollArrowStartForward,
-    eMetric_ScrollArrowStyleBothAtTop =                   // both arrows at top/left, none at bottom/right
-      eMetric_ScrollArrowStartBackward|eMetric_ScrollArrowStartForward
-  };
-  enum {
-    eMetric_ScrollThumbStyleNormal,
-    eMetric_ScrollThumbStyleProportional
-  };
-  
-  // When modifying this list, also modify nsXPLookAndFeel::sFloatPrefs
-  // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
-  typedef enum {
-    eMetricFloat_IMEUnderlineRelativeSize,
-    eMetricFloat_SpellCheckerUnderlineRelativeSize,
-
-    // The width/height ratio of the cursor. If used, the CaretWidth int metric
-    // should be added to the calculated caret width.
-    eMetricFloat_CaretAspectRatio
-  } nsMetricFloatID;
-
-  NS_IMETHOD GetColor(const nsColorID aID, nscolor &aColor) = 0;
-  NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric) = 0;
-  NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric) = 0;
-  virtual PRUnichar GetPasswordCharacter()
-  {
-    return PRUnichar('*');
-  }
-
-  virtual PRBool GetEchoPassword()
-  {
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
-    return PR_TRUE;
-#else
-    return PR_FALSE;
-#endif
-  }
-
-  NS_IMETHOD LookAndFeelChanged() = 0;
-
-
-#ifdef NS_DEBUG
-  typedef enum {
-    eMetricSize_TextField = 0,
-    eMetricSize_TextArea  = 1,
-    eMetricSize_ListBox   = 2,
-    eMetricSize_ComboBox  = 3,
-    eMetricSize_Radio     = 4,
-    eMetricSize_CheckBox  = 5,
-    eMetricSize_Button    = 6
-  } nsMetricNavWidgetID;
-
-  typedef enum {
-    eMetricSize_Courier   = 0,
-    eMetricSize_SansSerif = 1
-  } nsMetricNavFontID;
-
-  // This method returns the actual (or nearest estimate) 
-  // of the Navigator size for a given form control for a given font
-  // and font size. This is used in NavQuirks mode to see how closely
-  // we match its size
-  NS_IMETHOD GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                        const nsMetricNavFontID   aFontID, 
-                        const PRInt32             aFontSize, 
-                        nsSize &aSize) = 0;
-#endif
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsILookAndFeel, NS_ILOOKANDFEEL_IID)
-
 namespace mozilla {
 
 class LookAndFeel
 {
 public:
   // When modifying this list, also modify nsXPLookAndFeel::sColorPrefs
   // in widget/src/xpwidgts/nsXPLookAndFeel.cpp.
   enum ColorID {
--- a/widget/public/nsWidgetsCID.h
+++ b/widget/public/nsWidgetsCID.h
@@ -65,21 +65,16 @@
 /* 2d96b3e0-c051-11d1-a827-0040959a28c9 */
 #define NS_TOOLKIT_CID \
  { 0x2d96b3e0, 0xc051, 0x11d1, \
     {0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
 
 /* XXX the following CID's are not in order. This needs
    to be fixed. */
 
-/* A61E6398-2057-40fd-9C81-873B908D24E7 */
-#define NS_LOOKANDFEEL_CID \
-{ 0xa61e6398, 0x2057, 0x40fd,  \
-    { 0x9c, 0x81, 0x87, 0x3b, 0x90, 0x8d, 0x24, 0xe7 } }
-
 //-----------------------------------------------------------
 // Menus 
 //-----------------------------------------------------------
 
 // {0B3FE5AA-BC72-4303-85AE-76365DF1251D}
 #define NS_NATIVEMENUSERVICE_CID \
 { 0x0B3FE5AA, 0xBC72, 0x4303, \
   { 0x85, 0xAE, 0x76, 0x36, 0x5D, 0xF1, 0x25, 0x1D} }
--- a/widget/src/android/nsLookAndFeel.cpp
+++ b/widget/src/android/nsLookAndFeel.cpp
@@ -106,17 +106,17 @@ nsLookAndFeel::CallRemoteGetSystemColors
     memcpy(&mSystemColors, colors.Elements(), sizeof(nscolor) * colorsCount);
 
     mInitializedSystemColors = PR_TRUE;
 
     return NS_OK;
 }
 
 nsresult
-nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
+nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
 {
     nsresult rv = NS_OK;
 
     if (!mInitializedSystemColors) {
         if (XRE_GetProcessType() == GeckoProcessType_Default)
             rv = GetSystemColors();
         else
             rv = CallRemoteGetSystemColors();
@@ -125,352 +125,352 @@ nsLookAndFeel::NativeGetColor(const nsCo
 
     // XXX we'll want to use context.obtainStyledAttributes on the java side to
     // get all of these; see TextView.java for a good exmaple.
 
     switch (aID) {
         // These colors don't seem to be used for anything anymore in Mozilla
         // (except here at least TextSelectBackground and TextSelectForeground)
         // The CSS2 colors below are used.
-    case eColor_WindowBackground:
+    case eColorID_WindowBackground:
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_WindowForeground:
+    case eColorID_WindowForeground:
         aColor = mSystemColors.textColorPrimary;
         break;
-    case eColor_WidgetBackground:
+    case eColorID_WidgetBackground:
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_WidgetForeground:
+    case eColorID_WidgetForeground:
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor_WidgetSelectBackground:
+    case eColorID_WidgetSelectBackground:
         aColor = mSystemColors.textColorHighlight;
         break;
-    case eColor_WidgetSelectForeground:
+    case eColorID_WidgetSelectForeground:
         aColor = mSystemColors.textColorPrimaryInverse;
         break;
-    case eColor_Widget3DHighlight:
+    case eColorID_Widget3DHighlight:
         aColor = LIGHT_GRAY_COLOR;
         break;
-    case eColor_Widget3DShadow:
+    case eColorID_Widget3DShadow:
         aColor = DARK_GRAY_COLOR;
         break;
-    case eColor_TextBackground:
+    case eColorID_TextBackground:
         // not used?
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_TextForeground:
+    case eColorID_TextForeground:
         // not used?
         aColor = mSystemColors.textColorPrimary;
         break;
-    case eColor_TextSelectBackground:
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
+    case eColorID_TextSelectBackground:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
         // still used
         aColor = mSystemColors.textColorHighlight;
         break;
-    case eColor_TextSelectForeground:
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
+    case eColorID_TextSelectForeground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
         // still used
         aColor = mSystemColors.textColorPrimaryInverse;
         break;
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
         aColor = NS_TRANSPARENT;
         break;
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         break;
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         break;
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
         aColor = NS_TRANSPARENT;
         break;
-    case eColor_SpellCheckerUnderline:
+    case eColorID_SpellCheckerUnderline:
       aColor = RED_COLOR;
       break;
 
         // css2  http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
-    case eColor_activeborder:
+    case eColorID_activeborder:
         // active window border
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_activecaption:
+    case eColorID_activecaption:
         // active window caption background
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_appworkspace:
+    case eColorID_appworkspace:
         // MDI background color
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_background:
+    case eColorID_background:
         // desktop background
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_captiontext:
+    case eColorID_captiontext:
         // text in active window caption, size box, and scrollbar arrow box (!)
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor_graytext:
+    case eColorID_graytext:
         // disabled text in windows, menus, etc.
         aColor = mSystemColors.textColorTertiary;
         break;
-    case eColor_highlight:
+    case eColorID_highlight:
         // background of selected item
         aColor = mSystemColors.textColorHighlight;
         break;
-    case eColor_highlighttext:
+    case eColorID_highlighttext:
         // text of selected item
         aColor = mSystemColors.textColorPrimaryInverse;
         break;
-    case eColor_inactiveborder:
+    case eColorID_inactiveborder:
         // inactive window border
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_inactivecaption:
+    case eColorID_inactivecaption:
         // inactive window caption
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_inactivecaptiontext:
+    case eColorID_inactivecaptiontext:
         // text in inactive window caption
         aColor = mSystemColors.textColorTertiary;
         break;
-    case eColor_infobackground:
+    case eColorID_infobackground:
         // tooltip background color
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_infotext:
+    case eColorID_infotext:
         // tooltip text color
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor_menu:
+    case eColorID_menu:
         // menu background
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor_menutext:
+    case eColorID_menutext:
         // menu text
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor_scrollbar:
+    case eColorID_scrollbar:
         // scrollbar gray area
         aColor = mSystemColors.colorBackground;
         break;
 
-    case eColor_threedface:
-    case eColor_buttonface:
+    case eColorID_threedface:
+    case eColorID_buttonface:
         // 3-D face color
         aColor = mSystemColors.colorBackground;
         break;
 
-    case eColor_buttontext:
+    case eColorID_buttontext:
         // text on push buttons
         aColor = mSystemColors.colorForeground;
         break;
 
-    case eColor_buttonhighlight:
+    case eColorID_buttonhighlight:
         // 3-D highlighted edge color
-    case eColor_threedhighlight:
+    case eColorID_threedhighlight:
         // 3-D highlighted outer edge color
         aColor = LIGHT_GRAY_COLOR;
         break;
 
-    case eColor_threedlightshadow:
+    case eColorID_threedlightshadow:
         // 3-D highlighted inner edge color
         aColor = mSystemColors.colorBackground;
         break;
 
-    case eColor_buttonshadow:
+    case eColorID_buttonshadow:
         // 3-D shadow edge color
-    case eColor_threedshadow:
+    case eColorID_threedshadow:
         // 3-D shadow inner edge color
         aColor = GRAY_COLOR;
         break;
 
-    case eColor_threeddarkshadow:
+    case eColorID_threeddarkshadow:
         // 3-D shadow outer edge color
         aColor = BLACK_COLOR;
         break;
 
-    case eColor_window:
-    case eColor_windowframe:
+    case eColorID_window:
+    case eColorID_windowframe:
         aColor = mSystemColors.colorBackground;
         break;
 
-    case eColor_windowtext:
+    case eColorID_windowtext:
         aColor = mSystemColors.textColorPrimary;
         break;
 
-    case eColor__moz_eventreerow:
-    case eColor__moz_field:
+    case eColorID__moz_eventreerow:
+    case eColorID__moz_field:
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor__moz_fieldtext:
+    case eColorID__moz_fieldtext:
         aColor = mSystemColors.textColorPrimary;
         break;
-    case eColor__moz_dialog:
+    case eColorID__moz_dialog:
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor__moz_dialogtext:
+    case eColorID__moz_dialogtext:
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor__moz_dragtargetzone:
+    case eColorID__moz_dragtargetzone:
         aColor = mSystemColors.textColorHighlight;
         break;
-    case eColor__moz_buttondefault:
+    case eColorID__moz_buttondefault:
         // default button border color
         aColor = BLACK_COLOR;
         break;
-    case eColor__moz_buttonhoverface:
+    case eColorID__moz_buttonhoverface:
         aColor = BG_PRELIGHT_COLOR;
         break;
-    case eColor__moz_buttonhovertext:
+    case eColorID__moz_buttonhovertext:
         aColor = FG_PRELIGHT_COLOR;
         break;
-    case eColor__moz_cellhighlight:
-    case eColor__moz_html_cellhighlight:
+    case eColorID__moz_cellhighlight:
+    case eColorID__moz_html_cellhighlight:
         aColor = mSystemColors.textColorHighlight;
         break;
-    case eColor__moz_cellhighlighttext:
-    case eColor__moz_html_cellhighlighttext:
+    case eColorID__moz_cellhighlighttext:
+    case eColorID__moz_html_cellhighlighttext:
         aColor = mSystemColors.textColorPrimaryInverse;
         break;
-    case eColor__moz_menuhover:
+    case eColorID__moz_menuhover:
         aColor = BG_PRELIGHT_COLOR;
         break;
-    case eColor__moz_menuhovertext:
+    case eColorID__moz_menuhovertext:
         aColor = FG_PRELIGHT_COLOR;
         break;
-    case eColor__moz_oddtreerow:
+    case eColorID__moz_oddtreerow:
         aColor = NS_TRANSPARENT;
         break;
-    case eColor__moz_nativehyperlinktext:
+    case eColorID__moz_nativehyperlinktext:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         break;
-    case eColor__moz_comboboxtext:
+    case eColorID__moz_comboboxtext:
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor__moz_combobox:
+    case eColorID__moz_combobox:
         aColor = mSystemColors.colorBackground;
         break;
-    case eColor__moz_menubartext:
+    case eColorID__moz_menubartext:
         aColor = mSystemColors.colorForeground;
         break;
-    case eColor__moz_menubarhovertext:
+    case eColorID__moz_menubarhovertext:
         aColor = FG_PRELIGHT_COLOR;
         break;
     default:
         /* default color is BLACK */
         aColor = 0;
         rv = NS_ERROR_FAILURE;
         break;
     }
 
     return rv;
 }
 
 
-NS_IMETHODIMP
-nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 &aMetric)
+nsresult
+nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
-    nsresult rv = nsXPLookAndFeel::GetMetric(aID, aMetric);
+    nsresult rv = nsXPLookAndFeel::GetIntImpl(aID, aResult);
     if (NS_SUCCEEDED(rv))
         return rv;
 
     rv = NS_OK;
 
     switch (aID) {
-        case eMetric_CaretBlinkTime:
-            aMetric = 500;
+        case eIntID_CaretBlinkTime:
+            aResult = 500;
             break;
 
-        case eMetric_CaretWidth:
-            aMetric = 1;
+        case eIntID_CaretWidth:
+            aResult = 1;
             break;
 
-        case eMetric_ShowCaretDuringSelection:
-            aMetric = 0;
+        case eIntID_ShowCaretDuringSelection:
+            aResult = 0;
             break;
 
-        case eMetric_SelectTextfieldsOnKeyFocus:
+        case eIntID_SelectTextfieldsOnKeyFocus:
             // Select textfield content when focused by kbd
             // used by nsEventStateManager::sTextfieldSelectModel
-            aMetric = 1;
+            aResult = 1;
             break;
 
-        case eMetric_SubmenuDelay:
-            aMetric = 200;
+        case eIntID_SubmenuDelay:
+            aResult = 200;
             break;
 
-        case eMetric_MenusCanOverlapOSBar:
+        case eIntID_MenusCanOverlapOSBar:
             // we want XUL popups to be able to overlap the task bar.
-            aMetric = 1;
+            aResult = 1;
             break;
 
-        case eMetric_ScrollArrowStyle:
-            aMetric = eMetric_ScrollArrowStyleSingle;
+        case eIntID_ScrollArrowStyle:
+            aResult = eScrollArrowStyle_Single;
             break;
 
-        case eMetric_ScrollSliderStyle:
-            aMetric = eMetric_ScrollThumbStyleProportional;
+        case eIntID_ScrollSliderStyle:
+            aResult = eScrollThumbStyle_Proportional;
             break;
 
-        case eMetric_WindowsDefaultTheme:
-        case eMetric_TouchEnabled:
-        case eMetric_MaemoClassic:
-        case eMetric_WindowsThemeIdentifier:
-            aMetric = 0;
+        case eIntID_WindowsDefaultTheme:
+        case eIntID_TouchEnabled:
+        case eIntID_MaemoClassic:
+        case eIntID_WindowsThemeIdentifier:
+            aResult = 0;
             rv = NS_ERROR_NOT_IMPLEMENTED;
             break;
 
-        case eMetric_SpellCheckerUnderlineStyle:
-            aMetric = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
+        case eIntID_SpellCheckerUnderlineStyle:
+            aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
             break;
 
         default:
-            aMetric = 0;
+            aResult = 0;
             rv = NS_ERROR_FAILURE;
     }
 
     return rv;
 }
 
-NS_IMETHODIMP
-nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
-                         float &aMetric)
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
-    nsresult rv = nsXPLookAndFeel::GetMetric(aID, aMetric);
+    nsresult rv = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
     if (NS_SUCCEEDED(rv))
         return rv;
     rv = NS_OK;
 
     switch (aID) {
-        case eMetricFloat_IMEUnderlineRelativeSize:
-            aMetric = 1.0f;
+        case eFloatID_IMEUnderlineRelativeSize:
+            aResult = 1.0f;
             break;
 
-        case eMetricFloat_SpellCheckerUnderlineRelativeSize:
-            aMetric = 1.0f;
+        case eFloatID_SpellCheckerUnderlineRelativeSize:
+            aResult = 1.0f;
             break;
 
         default:
-            aMetric = -1.0;
+            aResult = -1.0;
             rv = NS_ERROR_FAILURE;
             break;
     }
     return rv;
 }
 
 /*virtual*/
-PRBool nsLookAndFeel::GetEchoPassword()
+PRBool
+nsLookAndFeel::GetEchoPasswordImpl()
 {
     if (!mInitializedShowPassword) {
         if (XRE_GetProcessType() == GeckoProcessType_Default) {
             if (AndroidBridge::Bridge())
                 mShowPassword = AndroidBridge::Bridge()->GetShowPasswordSetting();
             else
                 NS_ASSERTION(AndroidBridge::Bridge() != nsnull, "AndroidBridge is not available!");
         } else {
--- a/widget/src/android/nsLookAndFeel.h
+++ b/widget/src/android/nsLookAndFeel.h
@@ -43,20 +43,20 @@
 #include "AndroidBridge.h"
 
 class nsLookAndFeel: public nsXPLookAndFeel
 {
 public:
     nsLookAndFeel();
     virtual ~nsLookAndFeel();
 
-    nsresult NativeGetColor(const nsColorID aID, nscolor &aColor);
-    NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-    NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
-    virtual PRBool GetEchoPassword();
+    virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
+    virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+    virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
+    virtual PRBool GetEchoPasswordImpl();
 
 protected:
     static PRBool mInitializedSystemColors;
     static mozilla::AndroidSystemColors mSystemColors;
     static PRBool mInitializedShowPassword;
     static PRBool mShowPassword;
 
     nsresult GetSystemColors();
--- a/widget/src/android/nsWidgetFactory.cpp
+++ b/widget/src/android/nsWidgetFactory.cpp
@@ -58,18 +58,16 @@
 #include "nsFilePicker.h"
 #include "nsHTMLFormatConverter.h"
 #include "nsIMEPicker.h"
 #include "nsFilePickerProxy.h"
 #include "nsXULAppAPI.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsLookAndFeel,
-                                         nsLookAndFeel::GetAddRefedInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerAndroid)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIdleServiceAndroid)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsAndroid, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecAndroid)
@@ -101,17 +99,16 @@ nsFilePickerConstructor(nsISupports *aOu
 
   return picker->QueryInterface(aIID, aResult);
 }
 
 NS_DEFINE_NAMED_CID(NS_TOOLKIT_CID);
 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
-NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
 NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
 NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID);
 NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID);
@@ -120,17 +117,16 @@ NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERT
 NS_DEFINE_NAMED_CID(NS_IMEPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
   { &kNS_WINDOW_CID, false, NULL, nsWindowConstructor },
   { &kNS_CHILD_CID, false, NULL, nsWindowConstructor },
   { &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
   { &kNS_TOOLKIT_CID, false, NULL, nsToolkitConstructor },
-  { &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
   { &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerAndroidConstructor },
   { &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceAndroidConstructor },
   { &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
   { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
   { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
   { &kNS_PRINTSETTINGSSERVICE_CID, false, NULL, nsPrintOptionsAndroidConstructor },
   { &kNS_PRINTSESSION_CID, false, NULL, nsPrintSessionConstructor },
   { &kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecAndroidConstructor },
@@ -141,17 +137,16 @@ static const mozilla::Module::CIDEntry k
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
   { "@mozilla.org/widgets/window/android;1", &kNS_WINDOW_CID },
   { "@mozilla.org/widgets/child_window/android;1", &kNS_CHILD_CID },
   { "@mozilla.org/widget/appshell/android;1", &kNS_APPSHELL_CID },
   { "@mozilla.org/widget/toolkit/android;1", &kNS_TOOLKIT_CID },
-  { "@mozilla.org/widget/lookandfeel/android;1", &kNS_LOOKANDFEEL_CID },
   { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
   { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
   { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
   { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
   { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
   { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID },
   { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID },
   { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID },
--- a/widget/src/build/nsWinWidgetFactory.cpp
+++ b/widget/src/build/nsWinWidgetFactory.cpp
@@ -75,18 +75,16 @@
 #include "nsPrintSession.h"
 #endif
 
 using namespace mozilla::widget;
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsLookAndFeel,
-                                         nsLookAndFeel::GetAddRefedInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerWin)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIdleServiceWin)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
 
 #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_WIN7
@@ -119,17 +117,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceC
 
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
 NS_DEFINE_NAMED_CID(NS_TOOLKIT_CID);
 NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
-NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
 NS_DEFINE_NAMED_CID(NS_THEMERENDERER_CID);
 NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
 NS_DEFINE_NAMED_CID(NS_SOUND_CID);
 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
 
@@ -156,17 +153,16 @@ NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SP
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
   { &kNS_WINDOW_CID, false, NULL, nsWindowConstructor },
   { &kNS_CHILD_CID, false, NULL, ChildWindowConstructor },
   { &kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor },
   { &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
   { &kNS_TOOLKIT_CID, false, NULL, nsToolkitConstructor },
   { &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerWinConstructor },
   { &kNS_GFXINFO_CID, false, NULL, GfxInfoConstructor },
-  { &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
   { &kNS_THEMERENDERER_CID, false, NULL, NS_NewNativeTheme },
   { &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceWinConstructor },
   { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
   { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
   { &kNS_SOUND_CID, false, NULL, nsSoundConstructor },
   { &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
   { &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor },
 #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_WIN7
@@ -191,17 +187,16 @@ static const mozilla::Module::CIDEntry k
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
   { "@mozilla.org/widgets/window/win;1", &kNS_WINDOW_CID },
   { "@mozilla.org/widgets/child_window/win;1", &kNS_CHILD_CID },
   { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID },
   { "@mozilla.org/widget/appshell/win;1", &kNS_APPSHELL_CID },
   { "@mozilla.org/widget/toolkit/win;1", &kNS_TOOLKIT_CID },
   { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
   { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
-  { "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
   { "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
   { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
   { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
   { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
   { "@mozilla.org/sound;1", &kNS_SOUND_CID },
   { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
   { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
 #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_WIN7
--- a/widget/src/cocoa/nsLookAndFeel.h
+++ b/widget/src/cocoa/nsLookAndFeel.h
@@ -39,25 +39,25 @@
 #define nsLookAndFeel_h_
 #include "nsXPLookAndFeel.h"
 
 class nsLookAndFeel: public nsXPLookAndFeel {
 public:
   nsLookAndFeel();
   virtual ~nsLookAndFeel();
 
-  nsresult NativeGetColor(const nsColorID aID, nscolor &aColor);
-  NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-  NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
+  virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
+  virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+  virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
+  virtual PRUnichar GetPasswordCharacterImpl()
+  {
+    // unicode value for the bullet character, used for password textfields.
+    return 0x2022;
+  }
 
 protected:
 
   // Apple hasn't defined a constant for scollbars with two arrows on each end, so we'll use this one.
   static const int kThemeScrollBarArrowsBoth = 2;
   static const int kThemeScrollBarArrowsUpperLeft = 3;
-
-  PRUnichar GetPasswordCharacter() {
-    // unicode value for the bullet character, used for password textfields.
-    return 0x2022;
-  }
 };
 
 #endif // nsLookAndFeel_h_
--- a/widget/src/cocoa/nsLookAndFeel.mm
+++ b/widget/src/cocoa/nsLookAndFeel.mm
@@ -55,407 +55,410 @@ nsLookAndFeel::~nsLookAndFeel()
 static nscolor GetColorFromNSColor(NSColor* aColor)
 {
   NSColor* deviceColor = [aColor colorUsingColorSpaceName:NSDeviceRGBColorSpace];
   return NS_RGB((unsigned int)([deviceColor redComponent] * 255.0),
                 (unsigned int)([deviceColor greenComponent] * 255.0),
                 (unsigned int)([deviceColor blueComponent] * 255.0));
 }
 
-nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
+nsresult
+nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
 {
   nsresult res = NS_OK;
   
   switch (aID) {
-    case eColor_WindowBackground:
+    case eColorID_WindowBackground:
       aColor = NS_RGB(0xff,0xff,0xff);
       break;
-    case eColor_WindowForeground:
+    case eColorID_WindowForeground:
       aColor = NS_RGB(0x00,0x00,0x00);        
       break;
-    case eColor_WidgetBackground:
+    case eColorID_WidgetBackground:
       aColor = NS_RGB(0xdd,0xdd,0xdd);
       break;
-    case eColor_WidgetForeground:
+    case eColorID_WidgetForeground:
       aColor = NS_RGB(0x00,0x00,0x00);        
       break;
-    case eColor_WidgetSelectBackground:
+    case eColorID_WidgetSelectBackground:
       aColor = NS_RGB(0x80,0x80,0x80);
       break;
-    case eColor_WidgetSelectForeground:
+    case eColorID_WidgetSelectForeground:
       aColor = NS_RGB(0x00,0x00,0x80);
       break;
-    case eColor_Widget3DHighlight:
+    case eColorID_Widget3DHighlight:
       aColor = NS_RGB(0xa0,0xa0,0xa0);
       break;
-    case eColor_Widget3DShadow:
+    case eColorID_Widget3DShadow:
       aColor = NS_RGB(0x40,0x40,0x40);
       break;
-    case eColor_TextBackground:
+    case eColorID_TextBackground:
       aColor = NS_RGB(0xff,0xff,0xff);
       break;
-    case eColor_TextForeground:
+    case eColorID_TextForeground:
       aColor = NS_RGB(0x00,0x00,0x00);
       break;
-    case eColor_TextSelectBackground:
+    case eColorID_TextSelectBackground:
       aColor = GetColorFromNSColor([NSColor selectedTextBackgroundColor]);
       break;
-    case eColor_highlight: // CSS2 color
+    case eColorID_highlight: // CSS2 color
       aColor = GetColorFromNSColor([NSColor alternateSelectedControlColor]);
       break;
-    case eColor__moz_menuhover:
+    case eColorID__moz_menuhover:
       aColor = GetColorFromNSColor([NSColor alternateSelectedControlColor]);
       break;      
-    case eColor_TextSelectForeground:
-      GetColor(eColor_TextSelectBackground, aColor);
+    case eColorID_TextSelectForeground:
+      GetColor(eColorID_TextSelectBackground, aColor);
       if (aColor == 0x000000)
         aColor = NS_RGB(0xff,0xff,0xff);
       else
         aColor = NS_DONT_CHANGE_COLOR;
       break;
-    case eColor_highlighttext:  // CSS2 color
-    case eColor__moz_menuhovertext:
+    case eColorID_highlighttext:  // CSS2 color
+    case eColorID__moz_menuhovertext:
       aColor = GetColorFromNSColor([NSColor alternateSelectedControlTextColor]);
       break;
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
       aColor = NS_TRANSPARENT;
       break;
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
       aColor = NS_SAME_AS_FOREGROUND_COLOR;
       break;
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
       aColor = NS_40PERCENT_FOREGROUND_COLOR;
       break;
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
       aColor = NS_SAME_AS_FOREGROUND_COLOR;
       break;
-    case eColor_SpellCheckerUnderline:
+    case eColorID_SpellCheckerUnderline:
       aColor = NS_RGB(0xff, 0, 0);
       break;
 
       //
       // css2 system colors http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
       //
       // It's really hard to effectively map these to the Appearance Manager properly,
       // since they are modeled word for word after the win32 system colors and don't have any 
       // real counterparts in the Mac world. I'm sure we'll be tweaking these for 
       // years to come. 
       //
       // Thanks to mpt26@student.canterbury.ac.nz for the hardcoded values that form the defaults
       //  if querying the Appearance Manager fails ;)
       //
       
-    case eColor_buttontext:
-    case eColor__moz_buttonhovertext:
+    case eColorID_buttontext:
+    case eColorID__moz_buttonhovertext:
       aColor = GetColorFromNSColor([NSColor controlTextColor]);
       break;
-    case eColor_captiontext:
-    case eColor_menutext:
-    case eColor_infotext:
-    case eColor__moz_menubartext:
+    case eColorID_captiontext:
+    case eColorID_menutext:
+    case eColorID_infotext:
+    case eColorID__moz_menubartext:
       aColor = GetColorFromNSColor([NSColor textColor]);
       break;
-    case eColor_windowtext:
+    case eColorID_windowtext:
       aColor = GetColorFromNSColor([NSColor windowFrameTextColor]);
       break;
-    case eColor_activecaption:
+    case eColorID_activecaption:
       aColor = GetColorFromNSColor([NSColor gridColor]);
       break;
-    case eColor_activeborder:
+    case eColorID_activeborder:
       aColor = NS_RGB(0x00,0x00,0x00);
       break;
-     case eColor_appworkspace:
+     case eColorID_appworkspace:
       aColor = NS_RGB(0xFF,0xFF,0xFF);
       break;
-    case eColor_background:
+    case eColorID_background:
       aColor = NS_RGB(0x63,0x63,0xCE);
       break;
-    case eColor_buttonface:
-    case eColor__moz_buttonhoverface:
+    case eColorID_buttonface:
+    case eColorID__moz_buttonhoverface:
       aColor = NS_RGB(0xF0,0xF0,0xF0);
       break;
-    case eColor_buttonhighlight:
+    case eColorID_buttonhighlight:
       aColor = NS_RGB(0xFF,0xFF,0xFF);
       break;
-    case eColor_buttonshadow:
+    case eColorID_buttonshadow:
       aColor = NS_RGB(0xDC,0xDC,0xDC);
       break;
-    case eColor_graytext:
+    case eColorID_graytext:
       aColor = GetColorFromNSColor([NSColor disabledControlTextColor]);
       break;
-    case eColor_inactiveborder:
+    case eColorID_inactiveborder:
       aColor = GetColorFromNSColor([NSColor controlBackgroundColor]);
       break;
-    case eColor_inactivecaption:
+    case eColorID_inactivecaption:
       aColor = GetColorFromNSColor([NSColor controlBackgroundColor]);
       break;
-    case eColor_inactivecaptiontext:
+    case eColorID_inactivecaptiontext:
       aColor = NS_RGB(0x45,0x45,0x45);
       break;
-    case eColor_scrollbar:
+    case eColorID_scrollbar:
       aColor = GetColorFromNSColor([NSColor scrollBarColor]);
       break;
-    case eColor_threeddarkshadow:
+    case eColorID_threeddarkshadow:
       aColor = NS_RGB(0xDC,0xDC,0xDC);
       break;
-    case eColor_threedshadow:
+    case eColorID_threedshadow:
       aColor = NS_RGB(0xE0,0xE0,0xE0);
       break;
-    case eColor_threedface:
+    case eColorID_threedface:
       aColor = NS_RGB(0xF0,0xF0,0xF0);
       break;
-    case eColor_threedhighlight:
+    case eColorID_threedhighlight:
       aColor = GetColorFromNSColor([NSColor highlightColor]);
       break;
-    case eColor_threedlightshadow:
+    case eColorID_threedlightshadow:
       aColor = NS_RGB(0xDA,0xDA,0xDA);
       break;
-    case eColor_menu:
+    case eColorID_menu:
       aColor = GetColorFromNSColor([NSColor alternateSelectedControlTextColor]);
       break;
-    case eColor_infobackground:
+    case eColorID_infobackground:
       aColor = NS_RGB(0xFF,0xFF,0xC7);
       break;
-    case eColor_windowframe:
+    case eColorID_windowframe:
       aColor = GetColorFromNSColor([NSColor gridColor]);
       break;
-    case eColor_window:
-    case eColor__moz_field:
-    case eColor__moz_combobox:
+    case eColorID_window:
+    case eColorID__moz_field:
+    case eColorID__moz_combobox:
       aColor = NS_RGB(0xff,0xff,0xff);
       break;
-    case eColor__moz_fieldtext:
-    case eColor__moz_comboboxtext:
+    case eColorID__moz_fieldtext:
+    case eColorID__moz_comboboxtext:
       aColor = GetColorFromNSColor([NSColor controlTextColor]);
       break;
-    case eColor__moz_dialog:
+    case eColorID__moz_dialog:
       aColor = GetColorFromNSColor([NSColor controlHighlightColor]);
       break;
-    case eColor__moz_dialogtext:
-    case eColor__moz_cellhighlighttext:
-    case eColor__moz_html_cellhighlighttext:
+    case eColorID__moz_dialogtext:
+    case eColorID__moz_cellhighlighttext:
+    case eColorID__moz_html_cellhighlighttext:
       aColor = GetColorFromNSColor([NSColor controlTextColor]);
       break;
-    case eColor__moz_dragtargetzone:
+    case eColorID__moz_dragtargetzone:
       aColor = GetColorFromNSColor([NSColor selectedControlColor]);
       break;
-    case eColor__moz_mac_chrome_active:
-    case eColor__moz_mac_chrome_inactive: {
-      int grey = NativeGreyColorAsInt(toolbarFillGrey, (aID == eColor__moz_mac_chrome_active));
+    case eColorID__moz_mac_chrome_active:
+    case eColorID__moz_mac_chrome_inactive: {
+      int grey = NativeGreyColorAsInt(toolbarFillGrey, (aID == eColorID__moz_mac_chrome_active));
       aColor = NS_RGB(grey, grey, grey);
     }
       break;
-    case eColor__moz_mac_focusring:
+    case eColorID__moz_mac_focusring:
       aColor = GetColorFromNSColor([NSColor keyboardFocusIndicatorColor]);
       break;
-    case eColor__moz_mac_menushadow:
+    case eColorID__moz_mac_menushadow:
       aColor = NS_RGB(0xA3,0xA3,0xA3);
       break;          
-    case eColor__moz_mac_menutextdisable:
+    case eColorID__moz_mac_menutextdisable:
       aColor = nsToolkit::OnSnowLeopardOrLater() ?
                  NS_RGB(0x88,0x88,0x88) : NS_RGB(0x98,0x98,0x98);
       break;      
-    case eColor__moz_mac_menutextselect:
+    case eColorID__moz_mac_menutextselect:
       aColor = GetColorFromNSColor([NSColor selectedMenuItemTextColor]);
       break;      
-    case eColor__moz_mac_disabledtoolbartext:
+    case eColorID__moz_mac_disabledtoolbartext:
       aColor = NS_RGB(0x3F,0x3F,0x3F);
       break;
-    case eColor__moz_mac_menuselect:
+    case eColorID__moz_mac_menuselect:
       aColor = GetColorFromNSColor([NSColor alternateSelectedControlColor]);
       break;
-    case eColor__moz_buttondefault:
+    case eColorID__moz_buttondefault:
       aColor = NS_RGB(0xDC,0xDC,0xDC);
       break;
-    case eColor__moz_mac_alternateprimaryhighlight:
+    case eColorID__moz_mac_alternateprimaryhighlight:
       aColor = GetColorFromNSColor([NSColor alternateSelectedControlColor]);
       break;
-    case eColor__moz_cellhighlight:
-    case eColor__moz_html_cellhighlight:
-    case eColor__moz_mac_secondaryhighlight:
+    case eColorID__moz_cellhighlight:
+    case eColorID__moz_html_cellhighlight:
+    case eColorID__moz_mac_secondaryhighlight:
       // For inactive list selection
       aColor = GetColorFromNSColor([NSColor secondarySelectedControlColor]);
       break;
-    case eColor__moz_eventreerow:
+    case eColorID__moz_eventreerow:
       // Background color of even list rows.
       aColor = GetColorFromNSColor([[NSColor controlAlternatingRowBackgroundColors] objectAtIndex:0]);
       break;
-    case eColor__moz_oddtreerow:
+    case eColorID__moz_oddtreerow:
       // Background color of odd list rows.
       aColor = GetColorFromNSColor([[NSColor controlAlternatingRowBackgroundColors] objectAtIndex:1]);
       break;
-    case eColor__moz_nativehyperlinktext:
+    case eColorID__moz_nativehyperlinktext:
       // There appears to be no available system defined color. HARDCODING to the appropriate color.
       aColor = NS_RGB(0x14,0x4F,0xAE);
       break;
     default:
       NS_WARNING("Someone asked nsILookAndFeel for a color I don't know about");
       aColor = NS_RGB(0xff,0xff,0xff);
       res = NS_ERROR_FAILURE;
       break;
     }
   
   return res;
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
+nsresult
+nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
     return res;
   res = NS_OK;
   
   switch (aID) {
-    case eMetric_CaretBlinkTime:
-      aMetric = 567;
+    case eIntID_CaretBlinkTime:
+      aResult = 567;
       break;
-    case eMetric_CaretWidth:
-      aMetric = 1;
+    case eIntID_CaretWidth:
+      aResult = 1;
       break;
-    case eMetric_ShowCaretDuringSelection:
-      aMetric = 0;
+    case eIntID_ShowCaretDuringSelection:
+      aResult = 0;
       break;
-    case eMetric_SelectTextfieldsOnKeyFocus:
+    case eIntID_SelectTextfieldsOnKeyFocus:
       // Select textfield content when focused by kbd
       // used by nsEventStateManager::sTextfieldSelectModel
-      aMetric = 1;
+      aResult = 1;
       break;
-    case eMetric_SubmenuDelay:
-      aMetric = 200;
+    case eIntID_SubmenuDelay:
+      aResult = 200;
       break;
-    case eMetric_MenusCanOverlapOSBar:
+    case eIntID_MenusCanOverlapOSBar:
       // xul popups are not allowed to overlap the menubar.
-      aMetric = 0;
+      aResult = 0;
       break;
-    case eMetric_SkipNavigatingDisabledMenuItem:
-      aMetric = 1;
+    case eIntID_SkipNavigatingDisabledMenuItem:
+      aResult = 1;
       break;
-    case eMetric_DragThresholdX:
-    case eMetric_DragThresholdY:
-      aMetric = 4;
+    case eIntID_DragThresholdX:
+    case eIntID_DragThresholdY:
+      aResult = 4;
       break;
-    case eMetric_ScrollArrowStyle:
+    case eIntID_ScrollArrowStyle:
       if (nsToolkit::OnLionOrLater()) {
         // OS X Lion's scrollbars have no arrows
-        aMetric = eMetric_ScrollArrowNone;
+        aResult = eScrollArrow_None;
       } else {
         NSString *buttonPlacement = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleScrollBarVariant"];
         if ([buttonPlacement isEqualToString:@"Single"]) {
-          aMetric = eMetric_ScrollArrowStyleSingle;
+          aResult = eScrollArrowStyle_Single;
         } else if ([buttonPlacement isEqualToString:@"DoubleMin"]) {
-          aMetric = eMetric_ScrollArrowStyleBothAtTop;
+          aResult = eScrollArrowStyle_BothAtTop;
         } else if ([buttonPlacement isEqualToString:@"DoubleBoth"]) {
-          aMetric = eMetric_ScrollArrowStyleBothAtEachEnd;
+          aResult = eScrollArrowStyle_BothAtEachEnd;
         } else {
-          aMetric = eMetric_ScrollArrowStyleBothAtBottom; // The default is BothAtBottom.
+          aResult = eScrollArrowStyle_BothAtBottom; // The default is BothAtBottom.
         }
       }
       break;
-    case eMetric_ScrollSliderStyle:
-      aMetric = eMetric_ScrollThumbStyleProportional;
+    case eIntID_ScrollSliderStyle:
+      aResult = eScrollThumbStyle_Proportional;
       break;
-    case eMetric_TreeOpenDelay:
-      aMetric = 1000;
+    case eIntID_TreeOpenDelay:
+      aResult = 1000;
       break;
-    case eMetric_TreeCloseDelay:
-      aMetric = 1000;
+    case eIntID_TreeCloseDelay:
+      aResult = 1000;
       break;
-    case eMetric_TreeLazyScrollDelay:
-      aMetric = 150;
+    case eIntID_TreeLazyScrollDelay:
+      aResult = 150;
       break;
-    case eMetric_TreeScrollDelay:
-      aMetric = 100;
+    case eIntID_TreeScrollDelay:
+      aResult = 100;
       break;
-    case eMetric_TreeScrollLinesMax:
-      aMetric = 3;
+    case eIntID_TreeScrollLinesMax:
+      aResult = 3;
       break;
-    case eMetric_DWMCompositor:
-    case eMetric_WindowsClassic:
-    case eMetric_WindowsDefaultTheme:
-    case eMetric_TouchEnabled:
-    case eMetric_MaemoClassic:
-    case eMetric_WindowsThemeIdentifier:
-      aMetric = 0;
+    case eIntID_DWMCompositor:
+    case eIntID_WindowsClassic:
+    case eIntID_WindowsDefaultTheme:
+    case eIntID_TouchEnabled:
+    case eIntID_MaemoClassic:
+    case eIntID_WindowsThemeIdentifier:
+      aResult = 0;
       res = NS_ERROR_NOT_IMPLEMENTED;
       break;
-    case eMetric_MacGraphiteTheme:
-      aMetric = [NSColor currentControlTint] == NSGraphiteControlTint;
+    case eIntID_MacGraphiteTheme:
+      aResult = [NSColor currentControlTint] == NSGraphiteControlTint;
       break;
-    case eMetric_MacLionTheme:
-      aMetric = nsToolkit::OnLionOrLater();
+    case eIntID_MacLionTheme:
+      aResult = nsToolkit::OnLionOrLater();
       break;
-    case eMetric_TabFocusModel:
+    case eIntID_TabFocusModel:
     {
       // we should probably cache this
       CFPropertyListRef fullKeyboardAccessProperty;
       fullKeyboardAccessProperty = ::CFPreferencesCopyValue(CFSTR("AppleKeyboardUIMode"),
                                                             kCFPreferencesAnyApplication,
                                                             kCFPreferencesCurrentUser,
                                                             kCFPreferencesAnyHost);
-      aMetric = 1;    // default to just textboxes
+      aResult = 1;    // default to just textboxes
       if (fullKeyboardAccessProperty) {
         PRInt32 fullKeyboardAccessPrefVal;
         if (::CFNumberGetValue((CFNumberRef) fullKeyboardAccessProperty, kCFNumberIntType, &fullKeyboardAccessPrefVal)) {
           // the second bit means  "Full keyboard access" is on
           if (fullKeyboardAccessPrefVal & (1 << 1))
-            aMetric = 7; // everything that can be focused
+            aResult = 7; // everything that can be focused
         }
         ::CFRelease(fullKeyboardAccessProperty);
       }
     }
       break;
-    case eMetric_ScrollToClick:
+    case eIntID_ScrollToClick:
     {
-      aMetric = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollerPagingBehavior"];
+      aResult = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollerPagingBehavior"];
     }
       break;
-    case eMetric_ChosenMenuItemsShouldBlink:
-      aMetric = 1;
+    case eIntID_ChosenMenuItemsShouldBlink:
+      aResult = 1;
       break;
-    case eMetric_IMERawInputUnderlineStyle:
-    case eMetric_IMEConvertedTextUnderlineStyle:
-    case eMetric_IMESelectedRawTextUnderlineStyle:
-    case eMetric_IMESelectedConvertedTextUnderline:
-      aMetric = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
+    case eIntID_IMERawInputUnderlineStyle:
+    case eIntID_IMEConvertedTextUnderlineStyle:
+    case eIntID_IMESelectedRawTextUnderlineStyle:
+    case eIntID_IMESelectedConvertedTextUnderline:
+      aResult = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
       break;
-    case eMetric_SpellCheckerUnderlineStyle:
-      aMetric = NS_STYLE_TEXT_DECORATION_STYLE_DOTTED;
+    case eIntID_SpellCheckerUnderlineStyle:
+      aResult = NS_STYLE_TEXT_DECORATION_STYLE_DOTTED;
       break;
     default:
-      aMetric = 0;
+      aResult = 0;
       res = NS_ERROR_FAILURE;
   }
   return res;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric)
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
     return res;
   res = NS_OK;
   
   switch (aID) {
-    case eMetricFloat_IMEUnderlineRelativeSize:
-      aMetric = 2.0f;
+    case eFloatID_IMEUnderlineRelativeSize:
+      aResult = 2.0f;
       break;
-    case eMetricFloat_SpellCheckerUnderlineRelativeSize:
-      aMetric = 2.0f;
+    case eFloatID_SpellCheckerUnderlineRelativeSize:
+      aResult = 2.0f;
       break;
     default:
-      aMetric = -1.0;
+      aResult = -1.0;
       res = NS_ERROR_FAILURE;
   }
 
   return res;
 }
--- a/widget/src/cocoa/nsWidgetFactory.mm
+++ b/widget/src/cocoa/nsWidgetFactory.mm
@@ -65,18 +65,16 @@
 #include "nsPrintOptionsX.h"
 #include "nsPrintDialogX.h"
 #include "nsPrintSession.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsCocoaWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildView)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsLookAndFeel,
-                                         nsLookAndFeel::GetAddRefedInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerCocoa)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecX)
@@ -110,17 +108,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxI
 
 
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_POPUP_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
 NS_DEFINE_NAMED_CID(NS_TOOLKIT_CID);
-NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
 NS_DEFINE_NAMED_CID(NS_SOUND_CID);
 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
 NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_BIDIKEYBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_THEMERENDERER_CID);
@@ -138,17 +135,16 @@ NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
   { &kNS_WINDOW_CID, false, NULL, nsCocoaWindowConstructor },
   { &kNS_POPUP_CID, false, NULL, nsCocoaWindowConstructor },
   { &kNS_CHILD_CID, false, NULL, nsChildViewConstructor },
   { &kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor },
   { &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
   { &kNS_TOOLKIT_CID, false, NULL, nsToolkitConstructor },
-  { &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
   { &kNS_SOUND_CID, false, NULL, nsSoundConstructor },
   { &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
   { &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor },
   { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
   { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
   { &kNS_DRAGSERVICE_CID, false, NULL, nsDragServiceConstructor },
   { &kNS_BIDIKEYBOARD_CID, false, NULL, nsBidiKeyboardConstructor },
   { &kNS_THEMERENDERER_CID, false, NULL, nsNativeThemeCocoaConstructor },
@@ -167,17 +163,16 @@ static const mozilla::Module::CIDEntry k
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
   { "@mozilla.org/widgets/window/mac;1", &kNS_WINDOW_CID },
   { "@mozilla.org/widgets/popup/mac;1", &kNS_POPUP_CID },
   { "@mozilla.org/widgets/childwindow/mac;1", &kNS_CHILD_CID },
   { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID },
   { "@mozilla.org/widget/appshell/mac;1", &kNS_APPSHELL_CID },
   { "@mozilla.org/widget/toolkit/mac;1", &kNS_TOOLKIT_CID },
-  { "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
   { "@mozilla.org/sound;1", &kNS_SOUND_CID },
   { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
   { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
   { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
   { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
   { "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID },
   { "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID },
   { "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
--- a/widget/src/gtk2/nsLookAndFeel.cpp
+++ b/widget/src/gtk2/nsLookAndFeel.cpp
@@ -91,254 +91,255 @@ nsLookAndFeel::nsLookAndFeel() : nsXPLoo
     }
 }
 
 nsLookAndFeel::~nsLookAndFeel()
 {
     g_object_unref(mStyle);
 }
 
-nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor& aColor)
+nsresult
+nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
 {
     nsresult res = NS_OK;
 
     switch (aID) {
         // These colors don't seem to be used for anything anymore in Mozilla
         // (except here at least TextSelectBackground and TextSelectForeground)
         // The CSS2 colors below are used.
-    case eColor_WindowBackground:
+    case eColorID_WindowBackground:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_NORMAL]);
         break;
-    case eColor_WindowForeground:
+    case eColorID_WindowForeground:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_NORMAL]);
         break;
-    case eColor_WidgetBackground:
+    case eColorID_WidgetBackground:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor_WidgetForeground:
+    case eColorID_WidgetForeground:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
         break;
-    case eColor_WidgetSelectBackground:
+    case eColorID_WidgetSelectBackground:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]);
         break;
-    case eColor_WidgetSelectForeground:
+    case eColorID_WidgetSelectForeground:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_SELECTED]);
         break;
-    case eColor_Widget3DHighlight:
+    case eColorID_Widget3DHighlight:
         aColor = NS_RGB(0xa0,0xa0,0xa0);
         break;
-    case eColor_Widget3DShadow:
+    case eColorID_Widget3DShadow:
         aColor = NS_RGB(0x40,0x40,0x40);
         break;
-    case eColor_TextBackground:
+    case eColorID_TextBackground:
         // not used?
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_NORMAL]);
         break;
-    case eColor_TextForeground: 
+    case eColorID_TextForeground: 
         // not used?
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_NORMAL]);
         break;
-    case eColor_TextSelectBackground:
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
+    case eColorID_TextSelectBackground:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
         // still used
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_SELECTED]);
         break;
-    case eColor_TextSelectForeground:
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
+    case eColorID_TextSelectForeground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
         // still used
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_SELECTED]);
         break;
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
         aColor = NS_TRANSPARENT;
         break;
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         break;
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         break;
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
         aColor = NS_TRANSPARENT;
         break;
-    case eColor_SpellCheckerUnderline:
+    case eColorID_SpellCheckerUnderline:
       aColor = NS_RGB(0xff, 0, 0);
       break;
 
         // css2  http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
-    case eColor_activeborder:
+    case eColorID_activeborder:
         // active window border
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor_activecaption:
+    case eColorID_activecaption:
         // active window caption background
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor_appworkspace:
+    case eColorID_appworkspace:
         // MDI background color
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor_background:
+    case eColorID_background:
         // desktop background
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor_captiontext:
+    case eColorID_captiontext:
         // text in active window caption, size box, and scrollbar arrow box (!)
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
         break;
-    case eColor_graytext:
+    case eColorID_graytext:
         // disabled text in windows, menus, etc.
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_INSENSITIVE]);
         break;
-    case eColor_highlight:
+    case eColorID_highlight:
         // background of selected item
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_SELECTED]);
         break;
-    case eColor_highlighttext:
+    case eColorID_highlighttext:
         // text of selected item
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_SELECTED]);
         break;
-    case eColor_inactiveborder:
+    case eColorID_inactiveborder:
         // inactive window border
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor_inactivecaption:
+    case eColorID_inactivecaption:
         // inactive window caption
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_INSENSITIVE]);
         break;
-    case eColor_inactivecaptiontext:
+    case eColorID_inactivecaptiontext:
         // text in inactive window caption
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_INSENSITIVE]);
         break;
-    case eColor_infobackground:
+    case eColorID_infobackground:
         // tooltip background color
         aColor = sInfoBackground;
         break;
-    case eColor_infotext:
+    case eColorID_infotext:
         // tooltip text color
         aColor = sInfoText;
         break;
-    case eColor_menu:
+    case eColorID_menu:
         // menu background
         aColor = sMenuBackground;
         break;
-    case eColor_menutext:
+    case eColorID_menutext:
         // menu text
         aColor = sMenuText;
         break;
-    case eColor_scrollbar:
+    case eColorID_scrollbar:
         // scrollbar gray area
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_ACTIVE]);
         break;
 
-    case eColor_threedface:
-    case eColor_buttonface:
+    case eColorID_threedface:
+    case eColorID_buttonface:
         // 3-D face color
         aColor = sButtonBackground;
         break;
 
-    case eColor_buttontext:
+    case eColorID_buttontext:
         // text on push buttons
         aColor = sButtonText;
         break;
 
-    case eColor_buttonhighlight:
+    case eColorID_buttonhighlight:
         // 3-D highlighted edge color
-    case eColor_threedhighlight:
+    case eColorID_threedhighlight:
         // 3-D highlighted outer edge color
         aColor = sButtonOuterLightBorder;
         break;
 
-    case eColor_threedlightshadow:
+    case eColorID_threedlightshadow:
         // 3-D highlighted inner edge color
         aColor = sButtonBackground; // always same as background in GTK code
         break;
 
-    case eColor_buttonshadow:
+    case eColorID_buttonshadow:
         // 3-D shadow edge color
-    case eColor_threedshadow:
+    case eColorID_threedshadow:
         // 3-D shadow inner edge color
         aColor = sButtonInnerDarkBorder;
         break;
 
-    case eColor_threeddarkshadow:
+    case eColorID_threeddarkshadow:
         // 3-D shadow outer edge color
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->black);
         break;
 
-    case eColor_window:
-    case eColor_windowframe:
+    case eColorID_window:
+    case eColorID_windowframe:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
 
-    case eColor_windowtext:
+    case eColorID_windowtext:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
         break;
 
-    case eColor__moz_eventreerow:
-    case eColor__moz_field:
+    case eColorID__moz_eventreerow:
+    case eColorID__moz_field:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_NORMAL]);
         break;
-    case eColor__moz_fieldtext:
+    case eColorID__moz_fieldtext:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_NORMAL]);
         break;
-    case eColor__moz_dialog:
+    case eColorID__moz_dialog:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_NORMAL]);
         break;
-    case eColor__moz_dialogtext:
+    case eColorID__moz_dialogtext:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]);
         break;
-    case eColor__moz_dragtargetzone:
+    case eColorID__moz_dragtargetzone:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_SELECTED]);
         break; 
-    case eColor__moz_buttondefault:
+    case eColorID__moz_buttondefault:
         // default button border color
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->black);
         break;
-    case eColor__moz_buttonhoverface:
+    case eColorID__moz_buttonhoverface:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->bg[GTK_STATE_PRELIGHT]);
         break;
-    case eColor__moz_buttonhovertext:
+    case eColorID__moz_buttonhovertext:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_PRELIGHT]);
         break;
-    case eColor__moz_cellhighlight:
-    case eColor__moz_html_cellhighlight:
+    case eColorID__moz_cellhighlight:
+    case eColorID__moz_html_cellhighlight:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_ACTIVE]);
         break;
-    case eColor__moz_cellhighlighttext:
-    case eColor__moz_html_cellhighlighttext:
+    case eColorID__moz_cellhighlighttext:
+    case eColorID__moz_html_cellhighlighttext:
         aColor = GDK_COLOR_TO_NS_RGB(mStyle->text[GTK_STATE_ACTIVE]);
         break;
-    case eColor__moz_menuhover:
+    case eColorID__moz_menuhover:
         aColor = sMenuHover;
         break;
-    case eColor__moz_menuhovertext:
+    case eColorID__moz_menuhovertext:
         aColor = sMenuHoverText;
         break;
-    case eColor__moz_oddtreerow:
+    case eColorID__moz_oddtreerow:
         aColor = sOddCellBackground;
         break;
-    case eColor__moz_nativehyperlinktext:
+    case eColorID__moz_nativehyperlinktext:
         aColor = sNativeHyperLinkText;
         break;
-    case eColor__moz_comboboxtext:
+    case eColorID__moz_comboboxtext:
         aColor = sComboBoxText;
         break;
-    case eColor__moz_combobox:
+    case eColorID__moz_combobox:
         aColor = sComboBoxBackground;
         break;
-    case eColor__moz_menubartext:
+    case eColorID__moz_menubartext:
         aColor = sMenuBarText;
         break;
-    case eColor__moz_menubarhovertext:
+    case eColorID__moz_menubarhovertext:
         aColor = sMenuBarHoverText;
         break;
     default:
         /* default color is BLACK */
         aColor = 0;
         res    = NS_ERROR_FAILURE;
         break;
     }
@@ -360,253 +361,254 @@ static void darken_gdk_color(GdkColor *s
     green *= 0.93;
     blue *= 0.93;
 
     dest->red = red * 65535.0;
     dest->green = green * 65535.0;
     dest->blue = blue * 65535.0;
 }
 
-static PRInt32 CheckWidgetStyle(GtkWidget* aWidget, const char* aStyle, PRInt32 aMetric) {
+static PRInt32 CheckWidgetStyle(GtkWidget* aWidget, const char* aStyle, PRInt32 aResult) {
     gboolean value = PR_FALSE;
     gtk_widget_style_get(aWidget, aStyle, &value, NULL);
-    return value ? aMetric : 0;
+    return value ? aResult : 0;
 }
 
 static PRInt32 ConvertGTKStepperStyleToMozillaScrollArrowStyle(GtkWidget* aWidget)
 {
     if (!aWidget)
-        return nsILookAndFeel::eMetric_ScrollArrowStyleSingle;
+        return mozilla::LookAndFeel::eScrollArrowStyle_Single;
   
     return
         CheckWidgetStyle(aWidget, "has-backward-stepper",
-                         nsILookAndFeel::eMetric_ScrollArrowStartBackward) |
+                         mozilla::LookAndFeel::eScrollArrow_StartBackward) |
         CheckWidgetStyle(aWidget, "has-forward-stepper",
-                         nsILookAndFeel::eMetric_ScrollArrowEndForward) |
+                         mozilla::LookAndFeel::eScrollArrow_EndForward) |
         CheckWidgetStyle(aWidget, "has-secondary-backward-stepper",
-                         nsILookAndFeel::eMetric_ScrollArrowEndBackward) |
+                         mozilla::LookAndFeel::eScrollArrow_EndBackward) |
         CheckWidgetStyle(aWidget, "has-secondary-forward-stepper",
-                         nsILookAndFeel::eMetric_ScrollArrowStartForward);
+                         mozilla::LookAndFeel::eScrollArrow_StartForward);
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
+nsresult
+nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
     nsresult res = NS_OK;
 
     // Set these before they can get overrided in the nsXPLookAndFeel. 
     switch (aID) {
-    case eMetric_ScrollButtonLeftMouseButtonAction:
-        aMetric = 0;
+    case eIntID_ScrollButtonLeftMouseButtonAction:
+        aResult = 0;
         return NS_OK;
-    case eMetric_ScrollButtonMiddleMouseButtonAction:
-        aMetric = 1;
+    case eIntID_ScrollButtonMiddleMouseButtonAction:
+        aResult = 1;
         return NS_OK;
-    case eMetric_ScrollButtonRightMouseButtonAction:
-        aMetric = 2;
+    case eIntID_ScrollButtonRightMouseButtonAction:
+        aResult = 2;
         return NS_OK;
     default:
         break;
     }
 
-    res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+    res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
     if (NS_SUCCEEDED(res))
         return res;
     res = NS_OK;
 
     switch (aID) {
-    case eMetric_CaretBlinkTime:
+    case eIntID_CaretBlinkTime:
         {
             GtkSettings *settings;
             gint blink_time;
             gboolean blink;
 
             settings = gtk_settings_get_default ();
             g_object_get (settings,
                           "gtk-cursor-blink-time", &blink_time,
                           "gtk-cursor-blink", &blink,
                           NULL);
  
             if (blink)
-                aMetric = (PRInt32) blink_time;
+                aResult = (PRInt32) blink_time;
             else
-                aMetric = 0;
+                aResult = 0;
             break;
         }
-    case eMetric_CaretWidth:
-        aMetric = 1;
+    case eIntID_CaretWidth:
+        aResult = 1;
         break;
-    case eMetric_ShowCaretDuringSelection:
-        aMetric = 0;
+    case eIntID_ShowCaretDuringSelection:
+        aResult = 0;
         break;
-    case eMetric_SelectTextfieldsOnKeyFocus:
+    case eIntID_SelectTextfieldsOnKeyFocus:
         {
             GtkWidget *entry;
             GtkSettings *settings;
             gboolean select_on_focus;
 
             entry = gtk_entry_new();
             g_object_ref_sink(entry);
             settings = gtk_widget_get_settings(entry);
             g_object_get(settings, 
                          "gtk-entry-select-on-focus",
                          &select_on_focus,
                          NULL);
             
             if(select_on_focus)
-                aMetric = 1;
+                aResult = 1;
             else
-                aMetric = 0;
+                aResult = 0;
 
             gtk_widget_destroy(entry);
             g_object_unref(entry);
         }
         break;
-    case eMetric_SubmenuDelay:
+    case eIntID_SubmenuDelay:
         {
             GtkSettings *settings;
             gint delay;
 
             settings = gtk_settings_get_default ();
             g_object_get (settings, "gtk-menu-popup-delay", &delay, NULL);
-            aMetric = (PRInt32) delay;
+            aResult = (PRInt32) delay;
             break;
         }
-    case eMetric_MenusCanOverlapOSBar:
+    case eIntID_MenusCanOverlapOSBar:
         // we want XUL popups to be able to overlap the task bar.
-        aMetric = 1;
+        aResult = 1;
         break;
-    case eMetric_SkipNavigatingDisabledMenuItem:
-        aMetric = 1;
+    case eIntID_SkipNavigatingDisabledMenuItem:
+        aResult = 1;
         break;
-    case eMetric_DragThresholdX:
-    case eMetric_DragThresholdY:
+    case eIntID_DragThresholdX:
+    case eIntID_DragThresholdY:
         {
             GtkWidget* box = gtk_hbox_new(FALSE, 5);
             gint threshold = 0;
             g_object_get(gtk_widget_get_settings(box),
                          "gtk-dnd-drag-threshold", &threshold,
                          NULL);
             g_object_ref_sink(box);
             
-            aMetric = threshold;
+            aResult = threshold;
         }
         break;
-    case eMetric_ScrollArrowStyle:
+    case eIntID_ScrollArrowStyle:
         moz_gtk_init();
-        aMetric =
+        aResult =
             ConvertGTKStepperStyleToMozillaScrollArrowStyle(moz_gtk_get_scrollbar_widget());
         break;
-    case eMetric_ScrollSliderStyle:
-        aMetric = eMetric_ScrollThumbStyleProportional;
+    case eIntID_ScrollSliderStyle:
+        aResult = eScrollThumbStyle_Proportional;
         break;
-    case eMetric_TreeOpenDelay:
-        aMetric = 1000;
+    case eIntID_TreeOpenDelay:
+        aResult = 1000;
         break;
-    case eMetric_TreeCloseDelay:
-        aMetric = 1000;
+    case eIntID_TreeCloseDelay:
+        aResult = 1000;
         break;
-    case eMetric_TreeLazyScrollDelay:
-        aMetric = 150;
+    case eIntID_TreeLazyScrollDelay:
+        aResult = 150;
         break;
-    case eMetric_TreeScrollDelay:
-        aMetric = 100;
+    case eIntID_TreeScrollDelay:
+        aResult = 100;
         break;
-    case eMetric_TreeScrollLinesMax:
-        aMetric = 3;
+    case eIntID_TreeScrollLinesMax:
+        aResult = 3;
         break;
-    case eMetric_DWMCompositor:
-    case eMetric_WindowsClassic:
-    case eMetric_WindowsDefaultTheme:
-    case eMetric_WindowsThemeIdentifier:
-        aMetric = 0;
+    case eIntID_DWMCompositor:
+    case eIntID_WindowsClassic:
+    case eIntID_WindowsDefaultTheme:
+    case eIntID_WindowsThemeIdentifier:
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
-    case eMetric_TouchEnabled:
+    case eIntID_TouchEnabled:
 #ifdef MOZ_PLATFORM_MAEMO
         // All Hildon devices are touch-enabled
-        aMetric = 1;
+        aResult = 1;
 #else
-        aMetric = 0;
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
 #endif
         break;
-    case eMetric_MaemoClassic:
+    case eIntID_MaemoClassic:
 #ifdef MOZ_PLATFORM_MAEMO
         {
-            aMetric = 0;
+            aResult = 0;
             nsCOMPtr<nsIPropertyBag2> infoService(do_GetService("@mozilla.org/system-info;1"));
             if (infoService) {
                 nsCString deviceType;
                 nsresult rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("device"),
                                                                  deviceType);
                 if (NS_SUCCEEDED(rv)) {
                     if (deviceType.EqualsLiteral("Nokia N8xx"))
-                        aMetric = 1;
+                        aResult = 1;
                 }
             }
         }
 #else
-        aMetric = 0;
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
 #endif
         break;
-    case eMetric_MacGraphiteTheme:
-    case eMetric_MacLionTheme:
-        aMetric = 0;
+    case eIntID_MacGraphiteTheme:
+    case eIntID_MacLionTheme:
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
-    case eMetric_IMERawInputUnderlineStyle:
-    case eMetric_IMEConvertedTextUnderlineStyle:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
+    case eIntID_IMERawInputUnderlineStyle:
+    case eIntID_IMEConvertedTextUnderlineStyle:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
         break;
-    case eMetric_IMESelectedRawTextUnderlineStyle:
-    case eMetric_IMESelectedConvertedTextUnderline:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
+    case eIntID_IMESelectedRawTextUnderlineStyle:
+    case eIntID_IMESelectedConvertedTextUnderline:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
         break;
-    case eMetric_SpellCheckerUnderlineStyle:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
+    case eIntID_SpellCheckerUnderlineStyle:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
         break;
-    case eMetric_ImagesInMenus:
-        aMetric = moz_gtk_images_in_menus();
+    case eIntID_ImagesInMenus:
+        aResult = moz_gtk_images_in_menus();
         break;
-    case eMetric_ImagesInButtons:
-        aMetric = moz_gtk_images_in_buttons();
+    case eIntID_ImagesInButtons:
+        aResult = moz_gtk_images_in_buttons();
         break;
-    case eMetric_MenuBarDrag:
-        aMetric = sMenuSupportsDrag;
+    case eIntID_MenuBarDrag:
+        aResult = sMenuSupportsDrag;
         break;
     default:
-        aMetric = 0;
+        aResult = 0;
         res     = NS_ERROR_FAILURE;
     }
 
     return res;
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
-                                       float & aMetric)
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
     nsresult res = NS_OK;
-    res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+    res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
     if (NS_SUCCEEDED(res))
         return res;
     res = NS_OK;
 
     switch (aID) {
-    case eMetricFloat_IMEUnderlineRelativeSize:
-        aMetric = 1.0f;
+    case eFloatID_IMEUnderlineRelativeSize:
+        aResult = 1.0f;
         break;
-    case eMetricFloat_SpellCheckerUnderlineRelativeSize:
-        aMetric = 1.0f;
+    case eFloatID_SpellCheckerUnderlineRelativeSize:
+        aResult = 1.0f;
         break;
-    case eMetricFloat_CaretAspectRatio:
-        aMetric = sCaretRatio;
+    case eFloatID_CaretAspectRatio:
+        aResult = sCaretRatio;
         break;
     default:
-        aMetric = -1.0;
+        aResult = -1.0;
         res = NS_ERROR_FAILURE;
     }
     return res;
 }
 
 void
 nsLookAndFeel::InitLookAndFeel()
 {
@@ -786,26 +788,24 @@ nsLookAndFeel::InitLookAndFeel()
                          "cursor-aspect-ratio", &sCaretRatio,
                          NULL);
 
     gtk_widget_destroy(window);
 }
 
 // virtual
 PRUnichar
-nsLookAndFeel::GetPasswordCharacter()
+nsLookAndFeel::GetPasswordCharacterImpl()
 {
     return sInvisibleCharacter;
 }
 
-NS_IMETHODIMP
-nsLookAndFeel::LookAndFeelChanged()
+void
+nsLookAndFeel::RefreshImpl()
 {
-    nsXPLookAndFeel::LookAndFeelChanged();
+    nsXPLookAndFeel::RefreshImpl();
 
     g_object_unref(mStyle);
     mStyle = nsnull;
  
     InitWidget();
     InitLookAndFeel();
-
-    return NS_OK;
 }
--- a/widget/src/gtk2/nsLookAndFeel.h
+++ b/widget/src/gtk2/nsLookAndFeel.h
@@ -43,21 +43,21 @@
 #include "nsCOMPtr.h"
 #include <gtk/gtk.h>
 
 class nsLookAndFeel: public nsXPLookAndFeel {
 public:
     nsLookAndFeel();
     virtual ~nsLookAndFeel();
 
-    nsresult NativeGetColor(const nsColorID aID, nscolor &aColor);
-    NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-    NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
-    NS_IMETHOD LookAndFeelChanged();
-    virtual PRUnichar GetPasswordCharacter();
+    virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
+    virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+    virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
+    virtual void RefreshImpl();
+    virtual PRUnichar GetPasswordCharacterImpl();
 
 protected:
     GtkStyle *mStyle;
 
     // Cached colors, we have to create a dummy widget to actually
     // get the style
 
     static nscolor sInfoBackground;
--- a/widget/src/gtk2/nsWidgetFactory.cpp
+++ b/widget/src/gtk2/nsWidgetFactory.cpp
@@ -87,18 +87,16 @@ using namespace mozilla;
 #define XULFILEPICKER_CID \
   { 0x54ae32f8, 0x1dd2, 0x11b2, \
     { 0xa2, 0x09, 0xdf, 0x7c, 0x50, 0x53, 0x70, 0xf8} }
 static NS_DEFINE_CID(kXULFilePickerCID, XULFILEPICKER_CID);
 static NS_DEFINE_CID(kNativeFilePickerCID, NS_FILEPICKER_CID);
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildWindow)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsLookAndFeel,
-                                         nsLookAndFeel::GetAddRefedInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
 #ifdef MOZ_X11
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsClipboard, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
 #endif
@@ -226,17 +224,16 @@ nsNativeKeyBindingsTextAreaConstructor(n
 {
     return nsNativeKeyBindingsConstructor(aOuter, aIID, aResult,
                                           eKeyBindings_TextArea);
 }
 
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
-NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_SOUND_CID);
 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
 #ifdef MOZ_X11
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
 NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
 #endif
@@ -262,17 +259,16 @@ NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID)
 NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
 #endif
 
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
     { &kNS_WINDOW_CID, false, NULL, nsWindowConstructor },
     { &kNS_CHILD_CID, false, NULL, nsChildWindowConstructor },
     { &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
-    { &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
     { &kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor },
     { &kNS_SOUND_CID, false, NULL, nsSoundConstructor },
     { &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
 #ifdef MOZ_X11
     { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
     { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
     { &kNS_DRAGSERVICE_CID, false, NULL, nsDragServiceConstructor },
 #endif
@@ -299,17 +295,16 @@ static const mozilla::Module::CIDEntry k
 #endif
     { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
     { "@mozilla.org/widget/window/gtk;1", &kNS_WINDOW_CID },
     { "@mozilla.org/widgets/child_window/gtk;1", &kNS_CHILD_CID },
     { "@mozilla.org/widget/appshell/gtk;1", &kNS_APPSHELL_CID },
-    { "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
     { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID },
     { "@mozilla.org/sound;1", &kNS_SOUND_CID },
     { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
 #ifdef MOZ_X11
     { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
     { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
     { "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID },
 #endif
--- a/widget/src/os2/nsLookAndFeel.cpp
+++ b/widget/src/os2/nsLookAndFeel.cpp
@@ -48,217 +48,218 @@
 nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel()
 {
 }
 
 nsLookAndFeel::~nsLookAndFeel()
 {
 }
 
-nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
+nsresult
+nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
 {
   nsresult res = NS_OK;
 
   int idx;
   switch (aID) {
-    case eColor_WindowBackground:
+    case eColorID_WindowBackground:
         idx = SYSCLR_WINDOW;
         break;
-    case eColor_WindowForeground:
+    case eColorID_WindowForeground:
         idx = SYSCLR_WINDOWTEXT;
         break;
-    case eColor_WidgetBackground:
+    case eColorID_WidgetBackground:
         idx = SYSCLR_BUTTONMIDDLE;
         break;
-    case eColor_WidgetForeground:
+    case eColorID_WidgetForeground:
         idx = SYSCLR_WINDOWTEXT; 
         break;
-    case eColor_WidgetSelectBackground:
+    case eColorID_WidgetSelectBackground:
         idx = SYSCLR_HILITEBACKGROUND;
         break;
-    case eColor_WidgetSelectForeground:
+    case eColorID_WidgetSelectForeground:
         idx = SYSCLR_HILITEFOREGROUND;
         break;
-    case eColor_Widget3DHighlight:
+    case eColorID_Widget3DHighlight:
         idx = SYSCLR_BUTTONLIGHT;
         break;
-    case eColor_Widget3DShadow:
+    case eColorID_Widget3DShadow:
         idx = SYSCLR_BUTTONDARK;
         break;
-    case eColor_TextBackground:
+    case eColorID_TextBackground:
         idx = SYSCLR_WINDOW;
         break;
-    case eColor_TextForeground:
+    case eColorID_TextForeground:
         idx = SYSCLR_WINDOWTEXT;
         break;
-    case eColor_TextSelectBackground:
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
+    case eColorID_TextSelectBackground:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
         idx = SYSCLR_HILITEBACKGROUND;
         break;
-    case eColor_TextSelectForeground:
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
+    case eColorID_TextSelectForeground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
         idx = SYSCLR_HILITEFOREGROUND;
         break;
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
         aColor = NS_TRANSPARENT;
         return NS_OK;
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         return NS_OK;
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         return NS_OK;
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
         aColor = NS_TRANSPARENT;
         return NS_OK;
-    case eColor_SpellCheckerUnderline:
+    case eColorID_SpellCheckerUnderline:
         aColor = NS_RGB(0xff, 0, 0);
         return NS_OK;
 
     // New CSS 2 Color definitions
-    case eColor_activeborder:
+    case eColorID_activeborder:
       idx = SYSCLR_ACTIVEBORDER;
       break;
-    case eColor_activecaption:
+    case eColorID_activecaption:
       idx = SYSCLR_ACTIVETITLETEXT;
       break;
-    case eColor_appworkspace:
+    case eColorID_appworkspace:
       idx = SYSCLR_APPWORKSPACE;
       break;
-    case eColor_background:
+    case eColorID_background:
       idx = SYSCLR_BACKGROUND;
       break;
-    case eColor_buttonface:
-    case eColor__moz_buttonhoverface:
+    case eColorID_buttonface:
+    case eColorID__moz_buttonhoverface:
       idx = SYSCLR_BUTTONMIDDLE;
       break;
-    case eColor_buttonhighlight:
+    case eColorID_buttonhighlight:
       idx = SYSCLR_BUTTONLIGHT;
       break;
-    case eColor_buttonshadow:
+    case eColorID_buttonshadow:
       idx = SYSCLR_BUTTONDARK;
       break;
-    case eColor_buttontext:
-    case eColor__moz_buttonhovertext:
+    case eColorID_buttontext:
+    case eColorID__moz_buttonhovertext:
       idx = SYSCLR_MENUTEXT;
       break;
-    case eColor_captiontext:
+    case eColorID_captiontext:
       idx = SYSCLR_WINDOWTEXT;
       break;
-    case eColor_graytext:
+    case eColorID_graytext:
       idx = SYSCLR_MENUDISABLEDTEXT;
       break;
-    case eColor_highlight:
-    case eColor__moz_html_cellhighlight:
+    case eColorID_highlight:
+    case eColorID__moz_html_cellhighlight:
       idx = SYSCLR_HILITEBACKGROUND;
       break;
-    case eColor_highlighttext:
-    case eColor__moz_html_cellhighlighttext:
+    case eColorID_highlighttext:
+    case eColorID__moz_html_cellhighlighttext:
       idx = SYSCLR_HILITEFOREGROUND;
       break;
-    case eColor_inactiveborder:
+    case eColorID_inactiveborder:
       idx = SYSCLR_INACTIVEBORDER;
       break;
-    case eColor_inactivecaption:
+    case eColorID_inactivecaption:
       idx = SYSCLR_INACTIVETITLE;
       break;
-    case eColor_inactivecaptiontext:
+    case eColorID_inactivecaptiontext:
       idx = SYSCLR_INACTIVETITLETEXT;
       break;
-    case eColor_infobackground:
+    case eColorID_infobackground:
       aColor = NS_RGB( 255, 255, 228);
       return res;
-    case eColor_infotext:
+    case eColorID_infotext:
       idx = SYSCLR_WINDOWTEXT;
       break;
-    case eColor_menu:
+    case eColorID_menu:
       idx = SYSCLR_MENU;
       break;
-    case eColor_menutext:
-    case eColor__moz_menubartext:
+    case eColorID_menutext:
+    case eColorID__moz_menubartext:
       idx = SYSCLR_MENUTEXT;
       break;
-    case eColor_scrollbar:
+    case eColorID_scrollbar:
       idx = SYSCLR_SCROLLBAR;
       break;
-    case eColor_threeddarkshadow:
+    case eColorID_threeddarkshadow:
       idx = SYSCLR_BUTTONDARK;
       break;
-    case eColor_threedface:
+    case eColorID_threedface:
       idx = SYSCLR_BUTTONMIDDLE;
       break;
-    case eColor_threedhighlight:
+    case eColorID_threedhighlight:
       idx = SYSCLR_BUTTONLIGHT;
       break;
-    case eColor_threedlightshadow:
+    case eColorID_threedlightshadow:
       idx = SYSCLR_BUTTONMIDDLE;
       break;
-    case eColor_threedshadow:
+    case eColorID_threedshadow:
       idx = SYSCLR_BUTTONDARK;
       break;
-    case eColor_window:
+    case eColorID_window:
       idx = SYSCLR_WINDOW;
       break;
-    case eColor_windowframe:
+    case eColorID_windowframe:
       idx = SYSCLR_WINDOWFRAME;
       break;
-    case eColor_windowtext:
+    case eColorID_windowtext:
       idx = SYSCLR_WINDOWTEXT;
       break;
-    case eColor__moz_eventreerow:
-    case eColor__moz_oddtreerow:
-    case eColor__moz_field:
-    case eColor__moz_combobox:
+    case eColorID__moz_eventreerow:
+    case eColorID__moz_oddtreerow:
+    case eColorID__moz_field:
+    case eColorID__moz_combobox:
       idx = SYSCLR_ENTRYFIELD;
       break;
-    case eColor__moz_fieldtext:
-    case eColor__moz_comboboxtext:
+    case eColorID__moz_fieldtext:
+    case eColorID__moz_comboboxtext:
       idx = SYSCLR_WINDOWTEXT;
       break;
-    case eColor__moz_dialog:
-    case eColor__moz_cellhighlight:
+    case eColorID__moz_dialog:
+    case eColorID__moz_cellhighlight:
       idx = SYSCLR_DIALOGBACKGROUND;
       break;
-    case eColor__moz_dialogtext:
-    case eColor__moz_cellhighlighttext:
+    case eColorID__moz_dialogtext:
+    case eColorID__moz_cellhighlighttext:
       idx = SYSCLR_WINDOWTEXT;
       break;
-    case eColor__moz_buttondefault:
+    case eColorID__moz_buttondefault:
       idx = SYSCLR_BUTTONDEFAULT;
       break;
-    case eColor__moz_menuhover:
+    case eColorID__moz_menuhover:
       if (WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0) ==
           WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENU, 0)) {
         // if this happens, we would paint menu selections unreadable
         // (we are most likely on Warp3), so let's fake a dark grey
         // background for the selected menu item
         aColor = NS_RGB( 132, 130, 132);
         return res;
       } else {
         idx = SYSCLR_MENUHILITEBGND;
       }
       break;
-    case eColor__moz_menuhovertext:
-    case eColor__moz_menubarhovertext:
+    case eColorID__moz_menuhovertext:
+    case eColorID__moz_menubarhovertext:
       if (WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENUHILITEBGND, 0) ==
           WinQuerySysColor(HWND_DESKTOP, SYSCLR_MENU, 0)) {
         // white text to be readable on dark grey
         aColor = NS_RGB( 255, 255, 255);
         return res;
       } else {
         idx = SYSCLR_MENUHILITE;
       }
       break;
-    case eColor__moz_nativehyperlinktext:
+    case eColorID__moz_nativehyperlinktext:
       aColor = NS_RGB( 0, 0, 255);
       return res;
     default:
       idx = SYSCLR_WINDOW;
       break;
   }
 
   long lColor = WinQuerySysColor( HWND_DESKTOP, idx, 0);
@@ -267,174 +268,113 @@ nsresult nsLookAndFeel::NativeGetColor(c
   int iGreen = (lColor & RGB_GREEN) >> 8;
   int iBlue = (lColor & RGB_BLUE);
 
   aColor = NS_RGB( iRed, iGreen, iBlue);
 
   return res;
 }
   
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
+nsresult
+nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
       return res;
   res = NS_OK;
 
   switch (aID) {
-    case eMetric_CaretBlinkTime:
-        aMetric = WinQuerySysValue( HWND_DESKTOP, SV_CURSORRATE);
+    case eIntID_CaretBlinkTime:
+        aResult = WinQuerySysValue( HWND_DESKTOP, SV_CURSORRATE);
         break;
-    case eMetric_CaretWidth:
-        aMetric = 1;
+    case eIntID_CaretWidth:
+        aResult = 1;
         break;
-    case eMetric_ShowCaretDuringSelection:
-        aMetric = 0;
+    case eIntID_ShowCaretDuringSelection:
+        aResult = 0;
         break;
-    case eMetric_SelectTextfieldsOnKeyFocus:
+    case eIntID_SelectTextfieldsOnKeyFocus:
         // Do not select textfield content when focused by kbd
         // used by nsEventStateManager::sTextfieldSelectModel
-        aMetric = 0;
+        aResult = 0;
         break;
-    case eMetric_SubmenuDelay:
-        aMetric = 300;
+    case eIntID_SubmenuDelay:
+        aResult = 300;
         break;
-    case eMetric_MenusCanOverlapOSBar:
+    case eIntID_MenusCanOverlapOSBar:
         // we want XUL popups to be able to overlap the task bar.
-        aMetric = 1;
+        aResult = 1;
         break;
-    case eMetric_ScrollArrowStyle:
-        aMetric = eMetric_ScrollArrowStyleSingle;
+    case eIntID_ScrollArrowStyle:
+        aResult = eScrollArrowStyle_Single;
         break;
-    case eMetric_ScrollSliderStyle:
-        aMetric = eMetric_ScrollThumbStyleProportional;
+    case eIntID_ScrollSliderStyle:
+        aResult = eScrollThumbStyle_Proportional;
         break;
-    case eMetric_TreeOpenDelay:
-        aMetric = 1000;
+    case eIntID_TreeOpenDelay:
+        aResult = 1000;
         break;
-    case eMetric_TreeCloseDelay:
-        aMetric = 0;
+    case eIntID_TreeCloseDelay:
+        aResult = 0;
         break;
-    case eMetric_TreeLazyScrollDelay:
-        aMetric = 150;
+    case eIntID_TreeLazyScrollDelay:
+        aResult = 150;
         break;
-    case eMetric_TreeScrollDelay:
-        aMetric = 100;
+    case eIntID_TreeScrollDelay:
+        aResult = 100;
         break;
-    case eMetric_TreeScrollLinesMax:
-        aMetric = 3;
+    case eIntID_TreeScrollLinesMax:
+        aResult = 3;
         break;
-    case eMetric_DWMCompositor:
-    case eMetric_WindowsClassic:
-    case eMetric_WindowsDefaultTheme:
-    case eMetric_TouchEnabled:
-    case eMetric_WindowsThemeIdentifier:
-        aMetric = 0;
+    case eIntID_DWMCompositor:
+    case eIntID_WindowsClassic:
+    case eIntID_WindowsDefaultTheme:
+    case eIntID_TouchEnabled:
+    case eIntID_WindowsThemeIdentifier:
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
-    case eMetric_MacGraphiteTheme:
-    case eMetric_MacLionTheme:
-    case eMetric_MaemoClassic:
-        aMetric = 0;
+    case eIntID_MacGraphiteTheme:
+    case eIntID_MacLionTheme:
+    case eIntID_MaemoClassic:
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
-    case eMetric_IMERawInputUnderlineStyle:
-    case eMetric_IMEConvertedTextUnderlineStyle:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
+    case eIntID_IMERawInputUnderlineStyle:
+    case eIntID_IMEConvertedTextUnderlineStyle:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
         break;
-    case eMetric_IMESelectedRawTextUnderlineStyle:
-    case eMetric_IMESelectedConvertedTextUnderline:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
+    case eIntID_IMESelectedRawTextUnderlineStyle:
+    case eIntID_IMESelectedConvertedTextUnderline:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
         break;
-    case eMetric_SpellCheckerUnderlineStyle:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
+    case eIntID_SpellCheckerUnderlineStyle:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
         break;
 
     default:
-        aMetric = 0;
+        aResult = 0;
         res = NS_ERROR_FAILURE;
   }
   return res;
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric)
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
     return res;
   res = NS_OK;
 
   switch (aID) {
-    case eMetricFloat_IMEUnderlineRelativeSize:
-        aMetric = 1.0f;
+    case eFloatID_IMEUnderlineRelativeSize:
+        aResult = 1.0f;
         break;
-    case eMetricFloat_SpellCheckerUnderlineRelativeSize:
-        aMetric = 1.0f;
+    case eFloatID_SpellCheckerUnderlineRelativeSize:
+        aResult = 1.0f;
         break;
     default:
-        aMetric = -1.0;
+        aResult = -1.0;
         res = NS_ERROR_FAILURE;
   }
   return res;
 }
-
-
-#ifdef NS_DEBUG
-
-NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                                        const nsMetricNavFontID   aFontID, 
-                                        const PRInt32             aFontSize, 
-                                        nsSize &aSize)
-{
-  nsresult rv = nsXPLookAndFeel::GetNavSize(aWidgetID, aFontID, aFontSize,
-                                            aSize);
-  if (NS_SUCCEEDED(rv))
-      return rv;
-
-  aSize.width  = 0;
-  aSize.height = 0;
-
-  if (aFontSize < 1 || aFontSize > 7) {
-    return NS_ERROR_FAILURE;
-  }
-
-  PRInt32 kTextFieldWidths[2][7] = {
-    {106,147,169,211,253,338,506}, // Courier
-    {152,214,237,281,366,495,732}  // sans-serif
-  };
-
-  PRInt32 kTextFieldHeights[2][7] = {
-    {18,21,24,27,33,45,63}, // Courier
-    {18,21,24,27,34,48,67}  // sans-serif
-  };
-
-  PRInt32 kTextAreaWidths[2][7] = {
-    {121,163,184,226,268,352,520}, // Courier
-    {163,226,247,289,373,499,730}  // sans-serif
-  };
-
-  PRInt32 kTextAreaHeights[2][7] = {
-    {40,44,48,52,60,76,100}, // Courier
-    {40,44,48,52,62,80,106}  // sans-serif
-  };
-
-  switch (aWidgetID) {
-    case eMetricSize_TextField:
-      aSize.width  = kTextFieldWidths[aFontID][aFontSize-1];
-      aSize.height = kTextFieldHeights[aFontID][aFontSize-1];
-      break;
-    case eMetricSize_TextArea:
-      aSize.width  = kTextAreaWidths[aFontID][aFontSize-1];
-      aSize.height = kTextAreaHeights[aFontID][aFontSize-1];
-      break;
-   /* Added to avoid warning errors - these are not used right now */
-   case eMetricSize_ListBox:
-   case eMetricSize_ComboBox:
-   case eMetricSize_Radio:
-   case eMetricSize_CheckBox:
-   case eMetricSize_Button:
-      break;
-  } //switch
-
-  return NS_OK;
-
-}
-#endif
--- a/widget/src/os2/nsLookAndFeel.h
+++ b/widget/src/os2/nsLookAndFeel.h
@@ -39,25 +39,14 @@
 #define __nsLookAndFeel
 #include "nsXPLookAndFeel.h"
 
 class nsLookAndFeel: public nsXPLookAndFeel {
 public:
   nsLookAndFeel();
   virtual ~nsLookAndFeel();
 
-  nsresult NativeGetColor(const nsColorID aID, nscolor &aColor);
-  NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-  NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
-
-#ifdef NS_DEBUG
-  // This method returns the actual (or nearest estimate) 
-  // of the Navigator size for a given form control for a given font
-  // and font size. This is used in NavQuirks mode to see how closely
-  // we match its size
-  NS_IMETHOD GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                        const nsMetricNavFontID   aFontID, 
-                        const PRInt32             aFontSize, 
-                        nsSize &aSize);
-#endif
+  virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
+  virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+  virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
 };
 
 #endif
--- a/widget/src/os2/nsWidgetFactory.cpp
+++ b/widget/src/os2/nsWidgetFactory.cpp
@@ -88,18 +88,16 @@
 
 // objects that just require generic constructors
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildWindow)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsLookAndFeel,
-                                         nsLookAndFeel::GetAddRefedInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecOS2)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsOS2, Init)
@@ -111,17 +109,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsIdleSer
 // component definition, will be exported using XPCOM
 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
 NS_DEFINE_NAMED_CID(NS_BIDIKEYBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
 NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
-NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
 NS_DEFINE_NAMED_CID(NS_SOUND_CID);
 NS_DEFINE_NAMED_CID(NS_TOOLKIT_CID);
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
 NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID);
 NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID);
@@ -134,17 +131,16 @@ NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID)
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
     { &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
     { &kNS_BIDIKEYBOARD_CID, false, NULL, nsBidiKeyboardConstructor },
     { &kNS_CHILD_CID, false, NULL, nsChildWindowConstructor },
     { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
     { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
     { &kNS_DRAGSERVICE_CID, false, NULL, nsDragServiceConstructor },
     { &kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor },
-    { &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
     { &kNS_SOUND_CID, false, NULL, nsSoundConstructor },
     { &kNS_TOOLKIT_CID, false, NULL, nsToolkitConstructor },
     { &kNS_WINDOW_CID, false, NULL, nsWindowConstructor },
     { &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
     { &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor },
     { &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerOS2Constructor },
     { &kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecOS2Constructor },
     { &kNS_PRINTSETTINGSSERVICE_CID, false, NULL, nsPrintOptionsOS2Constructor },
@@ -158,17 +154,16 @@ static const mozilla::Module::CIDEntry k
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
   { "@mozilla.org/widget/appshell/os2;1", &kNS_APPSHELL_CID },
   { "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID },
   { "@mozilla.org/widget/child_window/os2;1", &kNS_CHILD_CID },
   { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
   { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
   { "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID },
   { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID },
-  { "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
   { "@mozilla.org/sound;1", &kNS_SOUND_CID },
   { "@mozilla.org/widget/toolkit/os2;1", &kNS_TOOLKIT_CID },
   { "@mozilla.org/widget/window/os2;1", &kNS_WINDOW_CID },
   { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
   { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
   { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
   { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID },
   { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID },
--- a/widget/src/qt/nsLookAndFeel.cpp
+++ b/widget/src/qt/nsLookAndFeel.cpp
@@ -58,392 +58,394 @@
 nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel()
 {
 }
 
 nsLookAndFeel::~nsLookAndFeel()
 {
 }
 
-nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID,nscolor &aColor)
+nsresult
+nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
 {
   nsresult res = NS_OK;
 
   if (!qApp)
     return NS_ERROR_FAILURE;
 
   QPalette palette = qApp->palette();
 
   switch (aID) {
-    case eColor_WindowBackground:
+    case eColorID_WindowBackground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_WindowForeground:
+    case eColorID_WindowForeground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_WidgetBackground:
+    case eColorID_WidgetBackground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_WidgetForeground:
+    case eColorID_WidgetForeground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::WindowText));
       break;
 
-    case eColor_WidgetSelectBackground:
+    case eColorID_WidgetSelectBackground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_WidgetSelectForeground:
+    case eColorID_WidgetSelectForeground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::WindowText));
       break;
 
-    case eColor_Widget3DHighlight:
+    case eColorID_Widget3DHighlight:
       aColor = NS_RGB(0xa0,0xa0,0xa0);
       break;
 
-    case eColor_Widget3DShadow:
+    case eColorID_Widget3DShadow:
       aColor = NS_RGB(0x40,0x40,0x40);
       break;
 
-    case eColor_TextBackground:
+    case eColorID_TextBackground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_TextForeground:
+    case eColorID_TextForeground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::WindowText));
       break;
 
-    case eColor_TextSelectBackground:
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
+    case eColorID_TextSelectBackground:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Highlight));
       break;
 
-    case eColor_TextSelectForeground:
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
+    case eColorID_TextSelectForeground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::HighlightedText));
       break;
 
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
       aColor = NS_TRANSPARENT;
       break;
 
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
       aColor = NS_SAME_AS_FOREGROUND_COLOR;
       break;
 
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
       aColor = NS_SAME_AS_FOREGROUND_COLOR;
       break;
 
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
       aColor = NS_TRANSPARENT;
       break;
 
-    case eColor_SpellCheckerUnderline:
+    case eColorID_SpellCheckerUnderline:
       aColor = NS_RGB(0xff, 0, 0);
       break;
 
-    case eColor_activeborder:
+    case eColorID_activeborder:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_activecaption:
+    case eColorID_activecaption:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_appworkspace:
+    case eColorID_appworkspace:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_background:
+    case eColorID_background:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_captiontext:
+    case eColorID_captiontext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Text));
       break;
 
-    case eColor_graytext:
+    case eColorID_graytext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Disabled, QPalette::Text));
       break;
 
-    case eColor_highlight:
+    case eColorID_highlight:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Highlight));
       break;
 
-    case eColor_highlighttext:
+    case eColorID_highlighttext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::HighlightedText));
       break;
 
-    case eColor_inactiveborder:
+    case eColorID_inactiveborder:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Disabled, QPalette::Window));
       break;
 
-    case eColor_inactivecaption:
+    case eColorID_inactivecaption:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Disabled, QPalette::Window));
       break;
 
-    case eColor_inactivecaptiontext:
+    case eColorID_inactivecaptiontext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Disabled, QPalette::Text));
       break;
 
-    case eColor_infobackground:
+    case eColorID_infobackground:
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::ToolTipBase));
 #else
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Base));
 #endif
       break;
 
-    case eColor_infotext:
+    case eColorID_infotext:
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::ToolTipText));
 #else
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Text));
 #endif
       break;
 
-    case eColor_menu:
+    case eColorID_menu:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_menutext:
-    case eColor__moz_menubartext:
+    case eColorID_menutext:
+    case eColorID__moz_menubartext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Text));
       break;
 
-    case eColor_scrollbar:
+    case eColorID_scrollbar:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Mid));
       break;
 
-    case eColor_threedface:
-    case eColor_buttonface:
+    case eColorID_threedface:
+    case eColorID_buttonface:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Button));
       break;
 
-    case eColor_buttonhighlight:
-    case eColor_threedhighlight:
+    case eColorID_buttonhighlight:
+    case eColorID_threedhighlight:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Dark));
       break;
 
-    case eColor_buttontext:
+    case eColorID_buttontext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::ButtonText));
       break;
 
-    case eColor_buttonshadow:
-    case eColor_threedshadow:
+    case eColorID_buttonshadow:
+    case eColorID_threedshadow:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Dark));
       break;
 
-    case eColor_threeddarkshadow:
+    case eColorID_threeddarkshadow:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Shadow));
       break;
 
-    case eColor_threedlightshadow:
+    case eColorID_threedlightshadow:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Light));
       break;
 
-    case eColor_window:
-    case eColor_windowframe:
+    case eColorID_window:
+    case eColorID_windowframe:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor_windowtext:
+    case eColorID_windowtext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Text));
       break;
 
      // from the CSS3 working draft (not yet finalized)
      // http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color
 
-    case eColor__moz_buttondefault:
+    case eColorID__moz_buttondefault:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Button));
       break;
 
-    case eColor__moz_field:
-    case eColor__moz_combobox:
+    case eColorID__moz_field:
+    case eColorID__moz_combobox:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Base));
       break;
 
-    case eColor__moz_fieldtext:
-    case eColor__moz_comboboxtext:
+    case eColorID__moz_fieldtext:
+    case eColorID__moz_comboboxtext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Text));
       break;
 
-    case eColor__moz_dialog:
+    case eColorID__moz_dialog:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor__moz_dialogtext:
+    case eColorID__moz_dialogtext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::WindowText));
       break;
 
-    case eColor__moz_dragtargetzone:
+    case eColorID__moz_dragtargetzone:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Window));
       break;
 
-    case eColor__moz_buttonhovertext:
+    case eColorID__moz_buttonhovertext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::ButtonText));
       break;
 
-    case eColor__moz_menuhovertext:
-    case eColor__moz_menubarhovertext:
+    case eColorID__moz_menuhovertext:
+    case eColorID__moz_menubarhovertext:
       aColor = QCOLOR_TO_NS_RGB(palette.color(QPalette::Normal, QPalette::Text));
       break;
 
     default:
       aColor = 0;
       res    = NS_ERROR_FAILURE;
       break;
   }
   return res;
 }
 
 #ifdef NS_LOOKANDFEEL_DEBUG
 static const char *metricToString[] = {
-    "eMetric_CaretBlinkTime",
-    "eMetric_CaretWidth",
-    "eMetric_ShowCaretDuringSelection",
-    "eMetric_SelectTextfieldsOnKeyFocus",
-    "eMetric_SubmenuDelay",
-    "eMetric_MenusCanOverlapOSBar",
-    "eMetric_SkipNavigatingDisabledMenuItem",
-    "eMetric_DragThresholdX",
-    "eMetric_DragThresholdY",
-    "eMetric_UseAccessibilityTheme",
-    "eMetric_ScrollArrowStyle",
-    "eMetric_ScrollSliderStyle",
-    "eMetric_ScrollButtonLeftMouseButtonAction",
-    "eMetric_ScrollButtonMiddleMouseButtonAction",
-    "eMetric_ScrollButtonRightMouseButtonAction",
-    "eMetric_TreeOpenDelay",
-    "eMetric_TreeCloseDelay",
-    "eMetric_TreeLazyScrollDelay",
-    "eMetric_TreeScrollDelay",
-    "eMetric_TreeScrollLinesMax",
-    "eMetric_TabFocusModel",
-    "eMetric_WindowsDefaultTheme",
-    "eMetric_AlertNotificationOrigin",
-    "eMetric_ScrollToClick",
-    "eMetric_IMERawInputUnderlineStyle",
-    "eMetric_IMESelectedRawTextUnderlineStyle",
-    "eMetric_IMEConvertedTextUnderlineStyle",
-    "eMetric_IMESelectedConvertedTextUnderline",
-    "eMetric_ImagesInMenus"
+    "eIntID_CaretBlinkTime",
+    "eIntID_CaretWidth",
+    "eIntID_ShowCaretDuringSelection",
+    "eIntID_SelectTextfieldsOnKeyFocus",
+    "eIntID_SubmenuDelay",
+    "eIntID_MenusCanOverlapOSBar",
+    "eIntID_SkipNavigatingDisabledMenuItem",
+    "eIntID_DragThresholdX",
+    "eIntID_DragThresholdY",
+    "eIntID_UseAccessibilityTheme",
+    "eIntID_ScrollArrowStyle",
+    "eIntID_ScrollSliderStyle",
+    "eIntID_ScrollButtonLeftMouseButtonAction",
+    "eIntID_ScrollButtonMiddleMouseButtonAction",
+    "eIntID_ScrollButtonRightMouseButtonAction",
+    "eIntID_TreeOpenDelay",
+    "eIntID_TreeCloseDelay",
+    "eIntID_TreeLazyScrollDelay",
+    "eIntID_TreeScrollDelay",
+    "eIntID_TreeScrollLinesMax",
+    "eIntID_TabFocusModel",
+    "eIntID_WindowsDefaultTheme",
+    "eIntID_AlertNotificationOrigin",
+    "eIntID_ScrollToClick",
+    "eIntID_IMERawInputUnderlineStyle",
+    "eIntID_IMESelectedRawTextUnderlineStyle",
+    "eIntID_IMEConvertedTextUnderlineStyle",
+    "eIntID_IMESelectedConvertedTextUnderline",
+    "eIntID_ImagesInMenus"
     };
 #endif
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID,PRInt32 &aMetric)
+nsresult
+nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
 #ifdef NS_LOOKANDFEEL_DEBUG
-  qDebug("nsLookAndFeel::GetMetric aID = %s", metricToString[aID]);
+  qDebug("nsLookAndFeel::GetIntImpl aID = %s", metricToString[aID]);
 #endif
 
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
       return res;
 
   res = NS_OK;
 
   switch (aID) {
-    case eMetric_CaretBlinkTime:
-      aMetric = 500;
+    case eIntID_CaretBlinkTime:
+      aResult = 500;
       break;
 
-    case eMetric_CaretWidth:
-      aMetric = 1;
+    case eIntID_CaretWidth:
+      aResult = 1;
       break;
 
-    case eMetric_ShowCaretDuringSelection:
-      aMetric = 0;
+    case eIntID_ShowCaretDuringSelection:
+      aResult = 0;
       break;
 
-    case eMetric_SelectTextfieldsOnKeyFocus:
+    case eIntID_SelectTextfieldsOnKeyFocus:
       // Select textfield content when focused by kbd
       // used by nsEventStateManager::sTextfieldSelectModel
-      aMetric = 1;
+      aResult = 1;
       break;
 
-    case eMetric_SubmenuDelay:
-      aMetric = 200;
+    case eIntID_SubmenuDelay:
+      aResult = 200;
       break;
 
-    case eMetric_MenusCanOverlapOSBar:
+    case eIntID_MenusCanOverlapOSBar:
       // we want XUL popups to be able to overlap the task bar.
-      aMetric = 1;
+      aResult = 1;
       break;
 
-    case eMetric_ScrollArrowStyle:
-      aMetric = eMetric_ScrollArrowStyleSingle;
+    case eIntID_ScrollArrowStyle:
+      aResult = eScrollArrowStyle_Single;
       break;
 
-    case eMetric_ScrollSliderStyle:
-      aMetric = eMetric_ScrollThumbStyleProportional;
+    case eIntID_ScrollSliderStyle:
+      aResult = eScrollThumbStyle_Proportional;
       break;
 
-    case eMetric_TouchEnabled:
+    case eIntID_TouchEnabled:
 #ifdef MOZ_PLATFORM_MAEMO
       // All known Maemo devices are touch enabled.
-      aMetric = 1;
+      aResult = 1;
 #else
-      aMetric = 0;
+      aResult = 0;
       res = NS_ERROR_NOT_IMPLEMENTED;
 #endif
       break;
 
-    case eMetric_WindowsDefaultTheme:
-    case eMetric_MaemoClassic:
-      aMetric = 0;
+    case eIntID_WindowsDefaultTheme:
+    case eIntID_MaemoClassic:
+      aResult = 0;
       res = NS_ERROR_NOT_IMPLEMENTED;
       break;
 
-    case eMetric_SpellCheckerUnderlineStyle:
-      aMetric = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
+    case eIntID_SpellCheckerUnderlineStyle:
+      aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
       break;
 
     default:
-      aMetric = 0;
+      aResult = 0;
       res = NS_ERROR_FAILURE;
   }
   return res;
 }
 
 #ifdef NS_LOOKANDFEEL_DEBUG
 static const char *floatMetricToString[] = {
-    "eMetricFloat_IMEUnderlineRelativeSize"
+    "eFloatID_IMEUnderlineRelativeSize"
 };
 #endif
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
-                                       float &aMetric)
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
 #ifdef NS_LOOKANDFEEL_DEBUG
-  qDebug("nsLookAndFeel::GetMetric aID = %s", floatMetricToString[aID]);
+  qDebug("nsLookAndFeel::GetFloatImpl aID = %s", floatMetricToString[aID]);
 #endif
 
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
       return res;
   res = NS_OK;
 
   switch (aID) {
-    case eMetricFloat_IMEUnderlineRelativeSize:
-      aMetric = 1.0f;
+    case eFloatID_IMEUnderlineRelativeSize:
+      aResult = 1.0f;
       break;
 
-    case eMetricFloat_SpellCheckerUnderlineRelativeSize:
-      aMetric = 1.0f;
+    case eFloatID_SpellCheckerUnderlineRelativeSize:
+      aResult = 1.0f;
       break;
 
     default:
-      aMetric = -1.0;
+      aResult = -1.0;
       res = NS_ERROR_FAILURE;
       break;
   }
   return res;
 }
--- a/widget/src/qt/nsLookAndFeel.h
+++ b/widget/src/qt/nsLookAndFeel.h
@@ -42,14 +42,14 @@
 #include "nsXPLookAndFeel.h"
 
 class nsLookAndFeel: public nsXPLookAndFeel
 {
 public:
     nsLookAndFeel();
     virtual ~nsLookAndFeel();
 
-    nsresult NativeGetColor(const nsColorID aID, nscolor &aColor);
-    NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-    NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
+    virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
+    virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+    virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
 };
 
 #endif
--- a/widget/src/qt/nsWidgetFactory.cpp
+++ b/widget/src/qt/nsWidgetFactory.cpp
@@ -78,18 +78,16 @@
 extern PRBool gDisableNativeTheme;
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsChildWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPopupWindow)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsLookAndFeel,
-                                         nsLookAndFeel::GetAddRefedInstance)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerQt)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBidiKeyboard)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIdleServiceQt)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
 
@@ -153,17 +151,16 @@ nsNativeThemeQtConstructor(nsISupports *
     NS_RELEASE(inst);
 
     return rv;
 }
 
 NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
 NS_DEFINE_NAMED_CID(NS_CHILD_CID);
 NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
-NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_SOUND_CID);
 NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
 NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
 NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
 NS_DEFINE_NAMED_CID(NS_BIDIKEYBOARD_CID);
@@ -183,17 +180,16 @@ NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVIC
 #if defined(MOZ_X11)
 NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
 #endif
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
     { &kNS_WINDOW_CID, false, NULL, nsWindowConstructor },
     { &kNS_CHILD_CID, false, NULL, nsChildWindowConstructor },
     { &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
-    { &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
     { &kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor },
     { &kNS_SOUND_CID, false, NULL, nsSoundConstructor },
     { &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
     { &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
     { &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
     { &kNS_DRAGSERVICE_CID, false, NULL, nsDragServiceConstructor },
     { &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor },
     { &kNS_BIDIKEYBOARD_CID, false, NULL, nsBidiKeyboardConstructor },
@@ -214,17 +210,16 @@ static const mozilla::Module::CIDEntry k
 #endif
     { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
     { "@mozilla.org/widget/window/qt;1", &kNS_WINDOW_CID },
     { "@mozilla.org/widgets/child_window/qt;1", &kNS_CHILD_CID },
     { "@mozilla.org/widget/appshell/qt;1", &kNS_APPSHELL_CID },
-    { "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
     { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID },
     { "@mozilla.org/sound;1", &kNS_SOUND_CID },
     { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
     { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
     { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
     { "@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID },
     { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
     { "@mozilla.org/widget/bidikeyboard;1", &kNS_BIDIKEYBOARD_CID },
--- a/widget/src/windows/nsLookAndFeel.cpp
+++ b/widget/src/windows/nsLookAndFeel.cpp
@@ -35,17 +35,16 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsLookAndFeel.h"
-#include "nsXPLookAndFeel.h"
 #include <windows.h>
 #include <shellapi.h>
 #include "nsWindow.h"
 #include "nsStyleConsts.h"
 #include "nsUXThemeData.h"
 #include "nsUXThemeConstants.h"
 
 typedef UINT (CALLBACK *SHAppBarMessagePtr)(DWORD, PAPPBARDATA);
@@ -89,351 +88,353 @@ nsLookAndFeel::~nsLookAndFeel()
    if (gShell32DLLInst)
    {
        FreeLibrary(gShell32DLLInst);
        gShell32DLLInst = NULL;
        gSHAppBarMessage = NULL;
    }
 }
 
-nsresult nsLookAndFeel::NativeGetColor(const nsColorID aID, nscolor &aColor)
+nsresult
+nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
 {
   nsresult res = NS_OK;
 
   int idx;
   switch (aID) {
-    case eColor_WindowBackground:
+    case eColorID_WindowBackground:
         idx = COLOR_WINDOW;
         break;
-    case eColor_WindowForeground:
+    case eColorID_WindowForeground:
         idx = COLOR_WINDOWTEXT;
         break;
-    case eColor_WidgetBackground:
+    case eColorID_WidgetBackground:
         idx = COLOR_BTNFACE;
         break;
-    case eColor_WidgetForeground:
+    case eColorID_WidgetForeground:
         idx = COLOR_BTNTEXT;
         break;
-    case eColor_WidgetSelectBackground:
+    case eColorID_WidgetSelectBackground:
         idx = COLOR_HIGHLIGHT;
         break;
-    case eColor_WidgetSelectForeground:
+    case eColorID_WidgetSelectForeground:
         idx = COLOR_HIGHLIGHTTEXT;
         break;
-    case eColor_Widget3DHighlight:
+    case eColorID_Widget3DHighlight:
         idx = COLOR_BTNHIGHLIGHT;
         break;
-    case eColor_Widget3DShadow:
+    case eColorID_Widget3DShadow:
         idx = COLOR_BTNSHADOW;
         break;
-    case eColor_TextBackground:
+    case eColorID_TextBackground:
         idx = COLOR_WINDOW;
         break;
-    case eColor_TextForeground:
+    case eColorID_TextForeground:
         idx = COLOR_WINDOWTEXT;
         break;
-    case eColor_TextSelectBackground:
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
+    case eColorID_TextSelectBackground:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
         idx = COLOR_HIGHLIGHT;
         break;
-    case eColor_TextSelectForeground:
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
+    case eColorID_TextSelectForeground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
         idx = COLOR_HIGHLIGHTTEXT;
         break;
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
         aColor = NS_TRANSPARENT;
         return NS_OK;
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         return NS_OK;
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
         aColor = NS_SAME_AS_FOREGROUND_COLOR;
         return NS_OK;
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
         aColor = NS_TRANSPARENT;
         return NS_OK;
-    case eColor_SpellCheckerUnderline:
+    case eColorID_SpellCheckerUnderline:
         aColor = NS_RGB(0xff, 0, 0);
         return NS_OK;
 
     // New CSS 2 Color definitions
-    case eColor_activeborder:
+    case eColorID_activeborder:
       idx = COLOR_ACTIVEBORDER;
       break;
-    case eColor_activecaption:
+    case eColorID_activecaption:
       idx = COLOR_ACTIVECAPTION;
       break;
-    case eColor_appworkspace:
+    case eColorID_appworkspace:
       idx = COLOR_APPWORKSPACE;
       break;
-    case eColor_background:
+    case eColorID_background:
       idx = COLOR_BACKGROUND;
       break;
-    case eColor_buttonface:
-    case eColor__moz_buttonhoverface:
+    case eColorID_buttonface:
+    case eColorID__moz_buttonhoverface:
       idx = COLOR_BTNFACE;
       break;
-    case eColor_buttonhighlight:
+    case eColorID_buttonhighlight:
       idx = COLOR_BTNHIGHLIGHT;
       break;
-    case eColor_buttonshadow:
+    case eColorID_buttonshadow:
       idx = COLOR_BTNSHADOW;
       break;
-    case eColor_buttontext:
-    case eColor__moz_buttonhovertext:
+    case eColorID_buttontext:
+    case eColorID__moz_buttonhovertext:
       idx = COLOR_BTNTEXT;
       break;
-    case eColor_captiontext:
+    case eColorID_captiontext:
       idx = COLOR_CAPTIONTEXT;
       break;
-    case eColor_graytext:
+    case eColorID_graytext:
       idx = COLOR_GRAYTEXT;
       break;
-    case eColor_highlight:
-    case eColor__moz_html_cellhighlight:
-    case eColor__moz_menuhover:
+    case eColorID_highlight:
+    case eColorID__moz_html_cellhighlight:
+    case eColorID__moz_menuhover:
       idx = COLOR_HIGHLIGHT;
       break;
-    case eColor__moz_menubarhovertext:
+    case eColorID__moz_menubarhovertext:
       if (!nsUXThemeData::sIsVistaOrLater || !nsUXThemeData::isAppThemed())
       {
         idx = nsUXThemeData::sFlatMenus ?
                 COLOR_HIGHLIGHTTEXT :
                 COLOR_MENUTEXT;
         break;
       }
       // Fall through
-    case eColor__moz_menuhovertext:
+    case eColorID__moz_menuhovertext:
       if (nsUXThemeData::IsAppThemed() && nsUXThemeData::sIsVistaOrLater)
       {
         res = ::GetColorFromTheme(eUXMenu,
                                   MENU_POPUPITEM, MPI_HOT, TMT_TEXTCOLOR, aColor);
         if (NS_SUCCEEDED(res))
           return res;
         // fall through to highlight case
       }
-    case eColor_highlighttext:
-    case eColor__moz_html_cellhighlighttext:
+    case eColorID_highlighttext:
+    case eColorID__moz_html_cellhighlighttext:
       idx = COLOR_HIGHLIGHTTEXT;
       break;
-    case eColor_inactiveborder:
+    case eColorID_inactiveborder:
       idx = COLOR_INACTIVEBORDER;
       break;
-    case eColor_inactivecaption:
+    case eColorID_inactivecaption:
       idx = COLOR_INACTIVECAPTION;
       break;
-    case eColor_inactivecaptiontext:
+    case eColorID_inactivecaptiontext:
       idx = COLOR_INACTIVECAPTIONTEXT;
       break;
-    case eColor_infobackground:
+    case eColorID_infobackground:
       idx = COLOR_INFOBK;
       break;
-    case eColor_infotext:
+    case eColorID_infotext:
       idx = COLOR_INFOTEXT;
       break;
-    case eColor_menu:
+    case eColorID_menu:
       idx = COLOR_MENU;
       break;
-    case eColor_menutext:
-    case eColor__moz_menubartext:
+    case eColorID_menutext:
+    case eColorID__moz_menubartext:
       idx = COLOR_MENUTEXT;
       break;
-    case eColor_scrollbar:
+    case eColorID_scrollbar:
       idx = COLOR_SCROLLBAR;
       break;
-    case eColor_threeddarkshadow:
+    case eColorID_threeddarkshadow:
       idx = COLOR_3DDKSHADOW;
       break;
-    case eColor_threedface:
+    case eColorID_threedface:
       idx = COLOR_3DFACE;
       break;
-    case eColor_threedhighlight:
+    case eColorID_threedhighlight:
       idx = COLOR_3DHIGHLIGHT;
       break;
-    case eColor_threedlightshadow:
+    case eColorID_threedlightshadow:
       idx = COLOR_3DLIGHT;
       break;
-    case eColor_threedshadow:
+    case eColorID_threedshadow:
       idx = COLOR_3DSHADOW;
       break;
-    case eColor_window:
+    case eColorID_window:
       idx = COLOR_WINDOW;
       break;
-    case eColor_windowframe:
+    case eColorID_windowframe:
       idx = COLOR_WINDOWFRAME;
       break;
-    case eColor_windowtext:
+    case eColorID_windowtext:
       idx = COLOR_WINDOWTEXT;
       break;
-    case eColor__moz_eventreerow:
-    case eColor__moz_oddtreerow:
-    case eColor__moz_field:
-    case eColor__moz_combobox:
+    case eColorID__moz_eventreerow:
+    case eColorID__moz_oddtreerow:
+    case eColorID__moz_field:
+    case eColorID__moz_combobox:
       idx = COLOR_WINDOW;
       break;
-    case eColor__moz_fieldtext:
-    case eColor__moz_comboboxtext:
+    case eColorID__moz_fieldtext:
+    case eColorID__moz_comboboxtext:
       idx = COLOR_WINDOWTEXT;
       break;
-    case eColor__moz_dialog:
-    case eColor__moz_cellhighlight:
+    case eColorID__moz_dialog:
+    case eColorID__moz_cellhighlight:
       idx = COLOR_3DFACE;
       break;
-    case eColor__moz_win_mediatext:
+    case eColorID__moz_win_mediatext:
       if (nsUXThemeData::IsAppThemed() && nsUXThemeData::sIsVistaOrLater) {
         res = ::GetColorFromTheme(eUXMediaToolbar,
                                   TP_BUTTON, TS_NORMAL, TMT_TEXTCOLOR, aColor);
         if (NS_SUCCEEDED(res))
           return res;
       }
       // if we've gotten here just return -moz-dialogtext instead
       idx = COLOR_WINDOWTEXT;
       break;
-    case eColor__moz_win_communicationstext:
+    case eColorID__moz_win_communicationstext:
       if (nsUXThemeData::IsAppThemed() && nsUXThemeData::sIsVistaOrLater)
       {
         res = ::GetColorFromTheme(eUXCommunicationsToolbar,
                                   TP_BUTTON, TS_NORMAL, TMT_TEXTCOLOR, aColor);
         if (NS_SUCCEEDED(res))
           return res;
       }
       // if we've gotten here just return -moz-dialogtext instead
       idx = COLOR_WINDOWTEXT;
       break;
-    case eColor__moz_dialogtext:
-    case eColor__moz_cellhighlighttext:
+    case eColorID__moz_dialogtext:
+    case eColorID__moz_cellhighlighttext:
       idx = COLOR_WINDOWTEXT;
       break;
-    case eColor__moz_dragtargetzone:
+    case eColorID__moz_dragtargetzone:
       idx = COLOR_HIGHLIGHTTEXT;
       break;
-    case eColor__moz_buttondefault:
+    case eColorID__moz_buttondefault:
       idx = COLOR_3DDKSHADOW;
       break;
-    case eColor__moz_nativehyperlinktext:
+    case eColorID__moz_nativehyperlinktext:
       idx = COLOR_HOTLIGHT;
       break;
     default:
       idx = COLOR_WINDOW;
       break;
     }
 
   DWORD color = ::GetSysColor(idx);
   aColor = COLOREF_2_NSRGB(color);
 
   return res;
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
+nsresult
+nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
     return res;
   res = NS_OK;
 
   switch (aID) {
-    case eMetric_CaretBlinkTime:
-        aMetric = (PRInt32)::GetCaretBlinkTime();
+    case eIntID_CaretBlinkTime:
+        aResult = (PRInt32)::GetCaretBlinkTime();
         break;
-    case eMetric_CaretWidth:
-        aMetric = 1;
+    case eIntID_CaretWidth:
+        aResult = 1;
         break;
-    case eMetric_ShowCaretDuringSelection:
-        aMetric = 0;
+    case eIntID_ShowCaretDuringSelection:
+        aResult = 0;
         break;
-    case eMetric_SelectTextfieldsOnKeyFocus:
+    case eIntID_SelectTextfieldsOnKeyFocus:
         // Select textfield content when focused by kbd
         // used by nsEventStateManager::sTextfieldSelectModel
-        aMetric = 1;
+        aResult = 1;
         break;
-    case eMetric_SubmenuDelay:
+    case eIntID_SubmenuDelay:
         // This will default to the Windows' default
         // (400ms) on error.
-        aMetric = GetSystemParam(SPI_GETMENUSHOWDELAY, 400);
+        aResult = GetSystemParam(SPI_GETMENUSHOWDELAY, 400);
         break;
-    case eMetric_MenusCanOverlapOSBar:
+    case eIntID_MenusCanOverlapOSBar:
         // we want XUL popups to be able to overlap the task bar.
-        aMetric = 1;
+        aResult = 1;
         break;
-    case eMetric_DragThresholdX:
+    case eIntID_DragThresholdX:
         // The system metric is the number of pixels at which a drag should
         // start.  Our look and feel metric is the number of pixels you can
         // move before starting a drag, so subtract 1.
 
-        aMetric = ::GetSystemMetrics(SM_CXDRAG) - 1;
+        aResult = ::GetSystemMetrics(SM_CXDRAG) - 1;
         break;
-    case eMetric_DragThresholdY:
-        aMetric = ::GetSystemMetrics(SM_CYDRAG) - 1;
+    case eIntID_DragThresholdY:
+        aResult = ::GetSystemMetrics(SM_CYDRAG) - 1;
         break;
-    case eMetric_UseAccessibilityTheme:
+    case eIntID_UseAccessibilityTheme:
         // High contrast is a misnomer under Win32 -- any theme can be used with it, 
         // e.g. normal contrast with large fonts, low contrast, etc.
         // The high contrast flag really means -- use this theme and don't override it.
         HIGHCONTRAST contrastThemeInfo;
         contrastThemeInfo.cbSize = sizeof(contrastThemeInfo);
         ::SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &contrastThemeInfo, 0);
 
-        aMetric = ((contrastThemeInfo.dwFlags & HCF_HIGHCONTRASTON) != 0);
+        aResult = ((contrastThemeInfo.dwFlags & HCF_HIGHCONTRASTON) != 0);
         break;
-    case eMetric_ScrollArrowStyle:
-        aMetric = eMetric_ScrollArrowStyleSingle;
+    case eIntID_ScrollArrowStyle:
+        aResult = eScrollArrowStyle_Single;
         break;
-    case eMetric_ScrollSliderStyle:
-        aMetric = eMetric_ScrollThumbStyleProportional;
+    case eIntID_ScrollSliderStyle:
+        aResult = eScrollThumbStyle_Proportional;
         break;
-    case eMetric_TreeOpenDelay:
-        aMetric = 1000;
+    case eIntID_TreeOpenDelay:
+        aResult = 1000;
         break;
-    case eMetric_TreeCloseDelay:
-        aMetric = 0;
+    case eIntID_TreeCloseDelay:
+        aResult = 0;
         break;
-    case eMetric_TreeLazyScrollDelay:
-        aMetric = 150;
+    case eIntID_TreeLazyScrollDelay:
+        aResult = 150;
         break;
-    case eMetric_TreeScrollDelay:
-        aMetric = 100;
+    case eIntID_TreeScrollDelay:
+        aResult = 100;
         break;
-    case eMetric_TreeScrollLinesMax:
-        aMetric = 3;
+    case eIntID_TreeScrollLinesMax:
+        aResult = 3;
         break;
-    case eMetric_WindowsClassic:
-        aMetric = !nsUXThemeData::IsAppThemed();
+    case eIntID_WindowsClassic:
+        aResult = !nsUXThemeData::IsAppThemed();
         break;
-    case eMetric_TouchEnabled:
-        aMetric = 0;
+    case eIntID_TouchEnabled:
+        aResult = 0;
         PRInt32 touchCapabilities;
         touchCapabilities = ::GetSystemMetrics(SM_DIGITIZER);
         if ((touchCapabilities & NID_READY) && 
            (touchCapabilities & (NID_EXTERNAL_TOUCH | NID_INTEGRATED_TOUCH))) {
-            aMetric = 1;
+            aResult = 1;
         }
         break;
-    case eMetric_WindowsDefaultTheme:
-        aMetric = nsUXThemeData::IsDefaultWindowTheme();
+    case eIntID_WindowsDefaultTheme:
+        aResult = nsUXThemeData::IsDefaultWindowTheme();
         break;
-    case eMetric_WindowsThemeIdentifier:
-        aMetric = nsUXThemeData::GetNativeThemeId();
+    case eIntID_WindowsThemeIdentifier:
+        aResult = nsUXThemeData::GetNativeThemeId();
         break;
-    case eMetric_MacGraphiteTheme:
-    case eMetric_MacLionTheme:
-    case eMetric_MaemoClassic:
-        aMetric = 0;
+    case eIntID_MacGraphiteTheme:
+    case eIntID_MacLionTheme:
+    case eIntID_MaemoClassic:
+        aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
-    case eMetric_DWMCompositor:
-        aMetric = nsUXThemeData::CheckForCompositor();
+    case eIntID_DWMCompositor:
+        aResult = nsUXThemeData::CheckForCompositor();
         break;
-    case eMetric_AlertNotificationOrigin:
-        aMetric = 0;
+    case eIntID_AlertNotificationOrigin:
+        aResult = 0;
         if (gSHAppBarMessage)
         {
           // Get task bar window handle
           HWND shellWindow = FindWindowW(L"Shell_TrayWnd", NULL);
 
           if (shellWindow != NULL)
           {
             // Determine position
@@ -442,136 +443,81 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(c
             appBarData.cbSize = sizeof(appBarData);
             if (gSHAppBarMessage(ABM_GETTASKBARPOS, &appBarData))
             {
               // Set alert origin as a bit field - see LookAndFeel.h
               // 0 represents bottom right, sliding vertically.
               switch(appBarData.uEdge)
               {
                 case ABE_LEFT:
-                  aMetric = NS_ALERT_HORIZONTAL | NS_ALERT_LEFT;
+                  aResult = NS_ALERT_HORIZONTAL | NS_ALERT_LEFT;
                   break;
                 case ABE_RIGHT:
-                  aMetric = NS_ALERT_HORIZONTAL;
+                  aResult = NS_ALERT_HORIZONTAL;
                   break;
                 case ABE_TOP:
-                  aMetric = NS_ALERT_TOP;
+                  aResult = NS_ALERT_TOP;
                   // fall through for the right-to-left handling.
                 case ABE_BOTTOM:
                   // If the task bar is right-to-left,
                   // move the origin to the left
                   if (::GetWindowLong(shellWindow, GWL_EXSTYLE) &
                         WS_EX_LAYOUTRTL)
-                    aMetric |= NS_ALERT_LEFT;
+                    aResult |= NS_ALERT_LEFT;
                   break;
               }
             }
           }
         }
         break;
-    case eMetric_IMERawInputUnderlineStyle:
-    case eMetric_IMEConvertedTextUnderlineStyle:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_DASHED;
+    case eIntID_IMERawInputUnderlineStyle:
+    case eIntID_IMEConvertedTextUnderlineStyle:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_DASHED;
         break;
-    case eMetric_IMESelectedRawTextUnderlineStyle:
-    case eMetric_IMESelectedConvertedTextUnderline:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
+    case eIntID_IMESelectedRawTextUnderlineStyle:
+    case eIntID_IMESelectedConvertedTextUnderline:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_NONE;
         break;
-    case eMetric_SpellCheckerUnderlineStyle:
-        aMetric = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
+    case eIntID_SpellCheckerUnderlineStyle:
+        aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
         break;
     default:
-        aMetric = 0;
+        aResult = 0;
         res = NS_ERROR_FAILURE;
     }
   return res;
 }
 
-NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric)
+nsresult
+nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
-  nsresult res = nsXPLookAndFeel::GetMetric(aID, aMetric);
+  nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
   if (NS_SUCCEEDED(res))
     return res;
   res = NS_OK;
 
   switch (aID) {
-    case eMetricFloat_IMEUnderlineRelativeSize:
-        aMetric = 1.0f;
+    case eFloatID_IMEUnderlineRelativeSize:
+        aResult = 1.0f;
         break;
-    case eMetricFloat_SpellCheckerUnderlineRelativeSize:
-        aMetric = 1.0f;
+    case eFloatID_SpellCheckerUnderlineRelativeSize:
+        aResult = 1.0f;
         break;
     default:
-        aMetric = -1.0;
+        aResult = -1.0;
         res = NS_ERROR_FAILURE;
     }
   return res;
 }
 
 /* virtual */
-PRUnichar nsLookAndFeel::GetPasswordCharacter()
+PRUnichar
+nsLookAndFeel::GetPasswordCharacterImpl()
 {
 #define UNICODE_BLACK_CIRCLE_CHAR 0x25cf
   static PRUnichar passwordCharacter = 0;
   if (!passwordCharacter) {
     passwordCharacter = '*';
     if (nsUXThemeData::sIsXPOrLater)
       passwordCharacter = UNICODE_BLACK_CIRCLE_CHAR;
   }
   return passwordCharacter;
 }
-
-#ifdef NS_DEBUG
-
-NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                                        const nsMetricNavFontID   aFontID, 
-                                        const PRInt32             aFontSize, 
-                                        nsSize &aSize)
-{
-  nsresult rv = nsXPLookAndFeel::GetNavSize(aWidgetID, aFontID, aFontSize,
-                                            aSize);
-  if (NS_SUCCEEDED(rv))
-    return rv;
-
-  aSize.width  = 0;
-  aSize.height = 0;
-
-  if (aFontSize < 1 || aFontSize > 7) {
-    return NS_ERROR_FAILURE;
-  }
-
-  PRInt32 kTextFieldWidths[2][7] = {
-    {106,147,169,211,253,338,506}, // Courier
-    {152,214,237,281,366,495,732}  // sans-serif
-  };
-
-  PRInt32 kTextFieldHeights[2][7] = {
-    {18,21,24,27,33,45,63}, // Courier
-    {18,21,24,27,34,48,67}  // sans-serif
-  };
-
-  PRInt32 kTextAreaWidths[2][7] = {
-    {121,163,184,226,268,352,520}, // Courier
-    {163,226,247,289,373,499,730}  // sans-serif
-  };
-
-  PRInt32 kTextAreaHeights[2][7] = {
-    {40,44,48,52,60,76,100}, // Courier
-    {40,44,48,52,62,80,106}  // sans-serif
-  };
-
-  switch (aWidgetID) {
-    case eMetricSize_TextField:
-      aSize.width  = kTextFieldWidths[aFontID][aFontSize-1];
-      aSize.height = kTextFieldHeights[aFontID][aFontSize-1];
-      break;
-    case eMetricSize_TextArea:
-      aSize.width  = kTextAreaWidths[aFontID][aFontSize-1];
-      aSize.height = kTextAreaHeights[aFontID][aFontSize-1];
-      break;
-    default:
-      break;
-  } //switch
-
-  return NS_OK;
-
-}
-#endif
--- a/widget/src/windows/nsLookAndFeel.h
+++ b/widget/src/windows/nsLookAndFeel.h
@@ -34,18 +34,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __nsLookAndFeel
 #define __nsLookAndFeel
 #include "nsXPLookAndFeel.h"
 
-#include "nsCOMPtr.h"
-
 /*
  * Gesture System Metrics
  */
 #ifndef SM_DIGITIZER
 #define SM_DIGITIZER         94
 #define TABLET_CONFIG_NONE   0x00000000
 #define NID_INTEGRATED_TOUCH 0x00000001
 #define NID_EXTERNAL_TOUCH   0x00000002
@@ -55,26 +53,15 @@
 #define NID_READY            0x00000080
 #endif
 
 class nsLookAndFeel: public nsXPLookAndFeel {
 public:
   nsLookAndFeel();
   virtual ~nsLookAndFeel();
 
-  nsresult NativeGetColor(const nsColorID aID, nscolor &aColor);
-  NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-  NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
-  virtual PRUnichar GetPasswordCharacter();
-
-#ifdef NS_DEBUG
-  // This method returns the actual (or nearest estimate) 
-  // of the Navigator size for a given form control for a given font
-  // and font size. This is used in NavQuirks mode to see how closely
-  // we match its size
-  NS_IMETHOD GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                        const nsMetricNavFontID   aFontID, 
-                        const PRInt32             aFontSize, 
-                        nsSize &aSize);
-#endif
+  virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
+  virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+  virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
+  virtual PRUnichar GetPasswordCharacterImpl();
 };
 
 #endif
--- a/widget/src/xpwidgets/nsXPLookAndFeel.cpp
+++ b/widget/src/xpwidgets/nsXPLookAndFeel.cpp
@@ -47,69 +47,100 @@
 #include "qcms.h"
 
 #ifdef DEBUG
 #include "nsSize.h"
 #endif
 
 using namespace mozilla;
 
-NS_IMPL_ISUPPORTS1(nsXPLookAndFeel, nsILookAndFeel)
-
 nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] =
 {
-  { "ui.caretBlinkTime", eMetric_CaretBlinkTime, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.caretWidth", eMetric_CaretWidth, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.caretVisibleWithSelection", eMetric_ShowCaretDuringSelection, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.submenuDelay", eMetric_SubmenuDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.dragThresholdX", eMetric_DragThresholdX, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.dragThresholdY", eMetric_DragThresholdY, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.useAccessibilityTheme", eMetric_UseAccessibilityTheme, PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.scrollbarsCanOverlapContent", eMetric_ScrollbarsCanOverlapContent,
-    PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.menusCanOverlapOSBar", eMetric_MenusCanOverlapOSBar,
-    PR_FALSE, nsLookAndFeelTypeInt, 0 },
-  { "ui.skipNavigatingDisabledMenuItem", eMetric_SkipNavigatingDisabledMenuItem, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+  { "ui.caretBlinkTime",
+    eIntID_CaretBlinkTime,
+    PR_FALSE, 0 },
+  { "ui.caretWidth",
+    eIntID_CaretWidth,
+    PR_FALSE, 0 },
+  { "ui.caretVisibleWithSelection",
+    eIntID_ShowCaretDuringSelection,
+    PR_FALSE, 0 },
+  { "ui.submenuDelay",
+    eIntID_SubmenuDelay,
+    PR_FALSE, 0 },
+  { "ui.dragThresholdX",
+    eIntID_DragThresholdX,
+    PR_FALSE, 0 },
+  { "ui.dragThresholdY",
+    eIntID_DragThresholdY,
+    PR_FALSE, 0 },
+  { "ui.useAccessibilityTheme",
+    eIntID_UseAccessibilityTheme,
+    PR_FALSE, 0 },
+  { "ui.scrollbarsCanOverlapContent",
+    eIntID_ScrollbarsCanOverlapContent,
+    PR_FALSE, 0 },
+  { "ui.menusCanOverlapOSBar",
+    eIntID_MenusCanOverlapOSBar,
+    PR_FALSE, 0 },
+  { "ui.skipNavigatingDisabledMenuItem",
+    eIntID_SkipNavigatingDisabledMenuItem,
+    PR_FALSE, 0 },
   { "ui.treeOpenDelay",
-    eMetric_TreeOpenDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_TreeOpenDelay,
+    PR_FALSE, 0 },
   { "ui.treeCloseDelay",
-    eMetric_TreeCloseDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_TreeCloseDelay,
+    PR_FALSE, 0 },
   { "ui.treeLazyScrollDelay",
-    eMetric_TreeLazyScrollDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_TreeLazyScrollDelay,
+    PR_FALSE, 0 },
   { "ui.treeScrollDelay",
-    eMetric_TreeScrollDelay, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_TreeScrollDelay,
+    PR_FALSE, 0 },
   { "ui.treeScrollLinesMax",
-    eMetric_TreeScrollLinesMax, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_TreeScrollLinesMax,
+    PR_FALSE, 0 },
   { "accessibility.tabfocus",
-    eMetric_TabFocusModel, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_TabFocusModel,
+    PR_FALSE, 0 },
   { "ui.alertNotificationOrigin",
-    eMetric_AlertNotificationOrigin, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_AlertNotificationOrigin,
+    PR_FALSE, 0 },
   { "ui.scrollToClick",
-    eMetric_ScrollToClick, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_ScrollToClick,
+    PR_FALSE, 0 },
   { "ui.IMERawInputUnderlineStyle",
-    eMetric_IMERawInputUnderlineStyle, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_IMERawInputUnderlineStyle,
+    PR_FALSE, 0 },
   { "ui.IMESelectedRawTextUnderlineStyle",
-    eMetric_IMESelectedRawTextUnderlineStyle, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_IMESelectedRawTextUnderlineStyle,
+    PR_FALSE, 0 },
   { "ui.IMEConvertedTextUnderlineStyle",
-    eMetric_IMEConvertedTextUnderlineStyle, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_IMEConvertedTextUnderlineStyle,
+    PR_FALSE, 0 },
   { "ui.IMESelectedConvertedTextUnderlineStyle",
-    eMetric_IMESelectedConvertedTextUnderline, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_IMESelectedConvertedTextUnderline,
+    PR_FALSE, 0 },
   { "ui.SpellCheckerUnderlineStyle",
-    eMetric_SpellCheckerUnderlineStyle, PR_FALSE, nsLookAndFeelTypeInt, 0 },
+    eIntID_SpellCheckerUnderlineStyle,
+    PR_FALSE, 0 },
 };
 
 nsLookAndFeelFloatPref nsXPLookAndFeel::sFloatPrefs[] =
 {
-  { "ui.IMEUnderlineRelativeSize", eMetricFloat_IMEUnderlineRelativeSize,
-    PR_FALSE, nsLookAndFeelTypeFloat, 0 },
+  { "ui.IMEUnderlineRelativeSize",
+    eFloatID_IMEUnderlineRelativeSize,
+    PR_FALSE, 0 },
   { "ui.SpellCheckerUnderlineRelativeSize",
-    eMetricFloat_SpellCheckerUnderlineRelativeSize, PR_FALSE,
-    nsLookAndFeelTypeFloat, 0 },
-  { "ui.caretAspectRatio", eMetricFloat_CaretAspectRatio, PR_FALSE,
-    nsLookAndFeelTypeFloat, 0 },
+    eFloatID_SpellCheckerUnderlineRelativeSize,
+    PR_FALSE, 0 },
+  { "ui.caretAspectRatio",
+    eFloatID_CaretAspectRatio,
+    PR_FALSE, 0 },
 };
 
 
 // This array MUST be kept in the same order as the color list in LookAndFeel.h.
 /* XXX If you add any strings longer than
  * "ui.IMESelectedConvertedTextBackground"
  * to the following array then you MUST update the
  * sizes of the sColorPrefs array in nsXPLookAndFeel.h
@@ -203,68 +234,58 @@ const char nsXPLookAndFeel::sColorPrefs[
   "ui.-moz-mac-secondaryhighlight",
   "ui.-moz-win-mediatext",
   "ui.-moz-win-communicationstext",
   "ui.-moz-nativehyperlinktext",
   "ui.-moz-comboboxtext",
   "ui.-moz-combobox"
 };
 
-PRInt32 nsXPLookAndFeel::sCachedColors[nsILookAndFeel::eColor_LAST_COLOR] = {0};
+PRInt32 nsXPLookAndFeel::sCachedColors[LookAndFeel::eColorID_LAST_COLOR] = {0};
 PRInt32 nsXPLookAndFeel::sCachedColorBits[COLOR_CACHE_SIZE] = {0};
 
 PRBool nsXPLookAndFeel::sInitialized = PR_FALSE;
 PRBool nsXPLookAndFeel::sUseNativeColors = PR_TRUE;
 
-nsXPLookAndFeel* nsXPLookAndFeel::sInstance = nsnull;
+nsLookAndFeel* nsXPLookAndFeel::sInstance = nsnull;
 PRBool nsXPLookAndFeel::sShutdown = PR_FALSE;
 
 // static
 nsLookAndFeel*
-nsXPLookAndFeel::GetAddRefedInstance()
-{
-  nsLookAndFeel* lookAndFeel = GetInstance();
-  NS_IF_ADDREF(lookAndFeel);
-  return lookAndFeel;
-}
-
-// static
-nsLookAndFeel*
 nsXPLookAndFeel::GetInstance()
 {
   if (sInstance) {
-    return static_cast<nsLookAndFeel*>(sInstance);
+    return sInstance;
   }
 
   NS_ENSURE_TRUE(!sShutdown, nsnull);
 
-  NS_ADDREF(sInstance = new nsLookAndFeel());
-  return static_cast<nsLookAndFeel*>(sInstance);
+  sInstance = new nsLookAndFeel();
+  return sInstance;
 }
 
 // static
 void
 nsXPLookAndFeel::Shutdown()
 {
   if (sShutdown) {
     return;
   }
   sShutdown = PR_TRUE;
-  if (sInstance) {
-    sInstance->Release();
-  }
+  delete sInstance;
+  sInstance = nsnull;
 }
 
-nsXPLookAndFeel::nsXPLookAndFeel() : nsILookAndFeel()
+nsXPLookAndFeel::nsXPLookAndFeel() : LookAndFeel()
 {
 }
 
 // static
 void
-nsXPLookAndFeel::IntPrefChanged (nsLookAndFeelIntPref *data)
+nsXPLookAndFeel::IntPrefChanged(nsLookAndFeelIntPref *data)
 {
   if (!data) {
     return;
   }
 
   PRInt32 intpref;
   nsresult rv = Preferences::GetInt(data->name, &intpref);
   if (NS_FAILED(rv)) {
@@ -274,28 +295,28 @@ nsXPLookAndFeel::IntPrefChanged (nsLookA
   data->isSet = PR_TRUE;
 #ifdef DEBUG_akkana
   printf("====== Changed int pref %s to %d\n", data->name, data->intVar);
 #endif
 }
 
 // static
 void
-nsXPLookAndFeel::FloatPrefChanged (nsLookAndFeelFloatPref *data)
+nsXPLookAndFeel::FloatPrefChanged(nsLookAndFeelFloatPref *data)
 {
   if (!data) {
     return;
   }
 
   PRInt32 intpref;
   nsresult rv = Preferences::GetInt(data->name, &intpref);
   if (NS_FAILED(rv)) {
     return;
   }
-  data->floatVar = (float)intpref / 100.;
+  data->floatVar = (float)intpref / 100.0f;
   data->isSet = PR_TRUE;
 #ifdef DEBUG_akkana
   printf("====== Changed float pref %s to %f\n", data->name, data->floatVar);
 #endif
 }
 
 // static
 void
@@ -344,17 +365,17 @@ nsXPLookAndFeel::InitFromPref(nsLookAndF
 
 void
 nsXPLookAndFeel::InitFromPref(nsLookAndFeelFloatPref* aPref)
 {
   PRInt32 intpref;
   nsresult rv = Preferences::GetInt(aPref->name, &intpref);
   if (NS_SUCCEEDED(rv)) {
     aPref->isSet = PR_TRUE;
-    aPref->floatVar = (float)intpref / 100.;
+    aPref->floatVar = (float)intpref / 100.0f;
   }
 }
 
 void
 nsXPLookAndFeel::InitColorFromPref(PRInt32 i)
 {
   nsAutoString colorStr;
   nsresult rv = Preferences::GetString(sColorPrefs[i], &colorStr);
@@ -447,34 +468,34 @@ nsXPLookAndFeel::Init()
 nsXPLookAndFeel::~nsXPLookAndFeel()
 {
   NS_ASSERTION(sInstance == this,
                "This destroying instance isn't the singleton instance");
   sInstance = nsnull;
 }
 
 PRBool
-nsXPLookAndFeel::IsSpecialColor(const nsColorID aID, nscolor &aColor)
+nsXPLookAndFeel::IsSpecialColor(ColorID aID, nscolor &aColor)
 {
   switch (aID) {
-    case eColor_TextSelectForeground:
+    case eColorID_TextSelectForeground:
       return (aColor == NS_DONT_CHANGE_COLOR);
-    case eColor_IMESelectedRawTextBackground:
-    case eColor_IMESelectedConvertedTextBackground:
-    case eColor_IMERawInputBackground:
-    case eColor_IMEConvertedTextBackground:
-    case eColor_IMESelectedRawTextForeground:
-    case eColor_IMESelectedConvertedTextForeground:
-    case eColor_IMERawInputForeground:
-    case eColor_IMEConvertedTextForeground:
-    case eColor_IMERawInputUnderline:
-    case eColor_IMEConvertedTextUnderline:
-    case eColor_IMESelectedRawTextUnderline:
-    case eColor_IMESelectedConvertedTextUnderline:
-    case eColor_SpellCheckerUnderline:
+    case eColorID_IMESelectedRawTextBackground:
+    case eColorID_IMESelectedConvertedTextBackground:
+    case eColorID_IMERawInputBackground:
+    case eColorID_IMEConvertedTextBackground:
+    case eColorID_IMESelectedRawTextForeground:
+    case eColorID_IMESelectedConvertedTextForeground:
+    case eColorID_IMERawInputForeground:
+    case eColorID_IMEConvertedTextForeground:
+    case eColorID_IMERawInputUnderline:
+    case eColorID_IMEConvertedTextUnderline:
+    case eColorID_IMESelectedRawTextUnderline:
+    case eColorID_IMESelectedConvertedTextUnderline:
+    case eColorID_SpellCheckerUnderline:
       return NS_IS_SELECTION_SPECIAL_COLOR(aColor);
     default:
       /*
        * In GetColor(), every color that is not a special color is color
        * corrected. Use PR_FALSE to make other colors color corrected.
        */
       return PR_FALSE;
   }
@@ -482,279 +503,258 @@ nsXPLookAndFeel::IsSpecialColor(const ns
 }
 
 //
 // All these routines will return NS_OK if they have a value,
 // in which case the nsLookAndFeel should use that value;
 // otherwise we'll return NS_ERROR_NOT_AVAILABLE, in which case, the
 // platform-specific nsLookAndFeel should use its own values instead.
 //
-NS_IMETHODIMP
-nsXPLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
+nsresult
+nsXPLookAndFeel::GetColorImpl(ColorID aID, nscolor &aResult)
 {
   if (!sInitialized)
     Init();
 
   // define DEBUG_SYSTEM_COLOR_USE if you want to debug system color
   // use in a skin that uses them.  When set, it will make all system
   // color pairs that are appropriate for foreground/background
   // pairing the same.  This means if the skin is using system colors
   // correctly you will not be able to see *any* text.
 #undef DEBUG_SYSTEM_COLOR_USE
 
 #ifdef DEBUG_SYSTEM_COLOR_USE
   {
     nsresult rv = NS_OK;
     switch (aID) {
         // css2  http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
-      case eColor_activecaption:
+      case eColorID_activecaption:
           // active window caption background
-      case eColor_captiontext:
+      case eColorID_captiontext:
           // text in active window caption
-        aColor = NS_RGB(0xff, 0x00, 0x00);
+        aResult = NS_RGB(0xff, 0x00, 0x00);
         break;
 
-      case eColor_highlight:
+      case eColorID_highlight:
           // background of selected item
-      case eColor_highlighttext:
+      case eColorID_highlighttext:
           // text of selected item
-        aColor = NS_RGB(0xff, 0xff, 0x00);
+        aResult = NS_RGB(0xff, 0xff, 0x00);
         break;
 
-      case eColor_inactivecaption:
+      case eColorID_inactivecaption:
           // inactive window caption
-      case eColor_inactivecaptiontext:
+      case eColorID_inactivecaptiontext:
           // text in inactive window caption
-        aColor = NS_RGB(0x66, 0x66, 0x00);
+        aResult = NS_RGB(0x66, 0x66, 0x00);
         break;
 
-      case eColor_infobackground:
+      case eColorID_infobackground:
           // tooltip background color
-      case eColor_infotext:
+      case eColorID_infotext:
           // tooltip text color
-        aColor = NS_RGB(0x00, 0xff, 0x00);
+        aResult = NS_RGB(0x00, 0xff, 0x00);
         break;
 
-      case eColor_menu:
+      case eColorID_menu:
           // menu background
-      case eColor_menutext:
+      case eColorID_menutext:
           // menu text
-        aColor = NS_RGB(0x00, 0xff, 0xff);
+        aResult = NS_RGB(0x00, 0xff, 0xff);
         break;
 
-      case eColor_threedface:
-      case eColor_buttonface:
+      case eColorID_threedface:
+      case eColorID_buttonface:
           // 3-D face color
-      case eColor_buttontext:
+      case eColorID_buttontext:
           // text on push buttons
-        aColor = NS_RGB(0x00, 0x66, 0x66);
+        aResult = NS_RGB(0x00, 0x66, 0x66);
         break;
 
-      case eColor_window:
-      case eColor_windowtext:
-        aColor = NS_RGB(0x00, 0x00, 0xff);
+      case eColorID_window:
+      case eColorID_windowtext:
+        aResult = NS_RGB(0x00, 0x00, 0xff);
         break;
 
       // from the CSS3 working draft (not yet finalized)
       // http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color
 
-      case eColor__moz_field:
-      case eColor__moz_fieldtext:
-        aColor = NS_RGB(0xff, 0x00, 0xff);
+      case eColorID__moz_field:
+      case eColorID__moz_fieldtext:
+        aResult = NS_RGB(0xff, 0x00, 0xff);
         break;
 
-      case eColor__moz_dialog:
-      case eColor__moz_dialogtext:
-        aColor = NS_RGB(0x66, 0x00, 0x66);
+      case eColorID__moz_dialog:
+      case eColorID__moz_dialogtext:
+        aResult = NS_RGB(0x66, 0x00, 0x66);
         break;
 
       default:
         rv = NS_ERROR_NOT_AVAILABLE;
     }
     if (NS_SUCCEEDED(rv))
       return rv;
   }
 #endif // DEBUG_SYSTEM_COLOR_USE
 
   if (IS_COLOR_CACHED(aID)) {
-    aColor = sCachedColors[aID];
+    aResult = sCachedColors[aID];
     return NS_OK;
   }
 
   // There are no system color settings for these, so set them manually
-  if (aID == eColor_TextSelectBackgroundDisabled) {
+  if (aID == eColorID_TextSelectBackgroundDisabled) {
     // This is used to gray out the selection when it's not focused
     // Used with nsISelectionController::SELECTION_DISABLED
-    aColor = NS_RGB(0xb0, 0xb0, 0xb0);
+    aResult = NS_RGB(0xb0, 0xb0, 0xb0);
     return NS_OK;
   }
 
-  if (aID == eColor_TextSelectBackgroundAttention) {
+  if (aID == eColorID_TextSelectBackgroundAttention) {
     // This makes the selection stand out when typeaheadfind is on
     // Used with nsISelectionController::SELECTION_ATTENTION
-    aColor = NS_RGB(0x38, 0xd8, 0x78);
+    aResult = NS_RGB(0x38, 0xd8, 0x78);
     return NS_OK;
   }
 
-  if (aID == eColor_TextHighlightBackground) {
+  if (aID == eColorID_TextHighlightBackground) {
     // This makes the matched text stand out when findbar highlighting is on
     // Used with nsISelectionController::SELECTION_FIND
-    aColor = NS_RGB(0xef, 0x0f, 0xff);
+    aResult = NS_RGB(0xef, 0x0f, 0xff);
     return NS_OK;
   }
 
-  if (aID == eColor_TextHighlightForeground) {
+  if (aID == eColorID_TextHighlightForeground) {
     // The foreground color for the matched text in findbar highlighting
     // Used with nsISelectionController::SELECTION_FIND
-    aColor = NS_RGB(0xff, 0xff, 0xff);
+    aResult = NS_RGB(0xff, 0xff, 0xff);
     return NS_OK;
   }
 
-  if (sUseNativeColors && NS_SUCCEEDED(NativeGetColor(aID, aColor))) {
-    if ((gfxPlatform::GetCMSMode() == eCMSMode_All) && !IsSpecialColor(aID, aColor)) {
+  if (sUseNativeColors && NS_SUCCEEDED(NativeGetColor(aID, aResult))) {
+    if ((gfxPlatform::GetCMSMode() == eCMSMode_All) &&
+         !IsSpecialColor(aID, aResult)) {
       qcms_transform *transform = gfxPlatform::GetCMSInverseRGBTransform();
       if (transform) {
         PRUint8 color[3];
-        color[0] = NS_GET_R(aColor);
-        color[1] = NS_GET_G(aColor);
-        color[2] = NS_GET_B(aColor);
+        color[0] = NS_GET_R(aResult);
+        color[1] = NS_GET_G(aResult);
+        color[2] = NS_GET_B(aResult);
         qcms_transform_data(transform, color, color, 1);
-        aColor = NS_RGB(color[0], color[1], color[2]);
+        aResult = NS_RGB(color[0], color[1], color[2]);
       }
     }
 
-    CACHE_COLOR(aID, aColor);
+    CACHE_COLOR(aID, aResult);
     return NS_OK;
   }
 
   return NS_ERROR_NOT_AVAILABLE;
 }
   
-NS_IMETHODIMP
-nsXPLookAndFeel::GetMetric(const nsMetricID aID, PRInt32& aMetric)
+nsresult
+nsXPLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
 {
   if (!sInitialized)
     Init();
 
   // Set the default values for these prefs. but allow different platforms
   // to override them in their nsLookAndFeel if desired.
   switch (aID) {
-    case eMetric_ScrollButtonLeftMouseButtonAction:
-      aMetric = 0;
+    case eIntID_ScrollButtonLeftMouseButtonAction:
+      aResult = 0;
       return NS_OK;
-    case eMetric_ScrollButtonMiddleMouseButtonAction:
-      aMetric = 3;
+    case eIntID_ScrollButtonMiddleMouseButtonAction:
+      aResult = 3;
       return NS_OK;
-    case eMetric_ScrollButtonRightMouseButtonAction:
-      aMetric = 3;
+    case eIntID_ScrollButtonRightMouseButtonAction:
+      aResult = 3;
       return NS_OK;
     default:
       /*
        * The metrics above are hardcoded platform defaults. All the other
        * metrics are stored in sIntPrefs and can be changed at runtime.
        */
     break;
   }
 
   for (unsigned int i = 0; i < NS_ARRAY_LENGTH(sIntPrefs); ++i) {
     if (sIntPrefs[i].isSet && (sIntPrefs[i].id == aID)) {
-      aMetric = sIntPrefs[i].intVar;
+      aResult = sIntPrefs[i].intVar;
       return NS_OK;
     }
   }
 
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-NS_IMETHODIMP
-nsXPLookAndFeel::GetMetric(const nsMetricFloatID aID, float& aMetric)
+nsresult
+nsXPLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
 {
   if (!sInitialized)
     Init();
 
   for (unsigned int i = 0; i < NS_ARRAY_LENGTH(sFloatPrefs); ++i) {
     if (sFloatPrefs[i].isSet && sFloatPrefs[i].id == aID) {
-      aMetric = sFloatPrefs[i].floatVar;
+      aResult = sFloatPrefs[i].floatVar;
       return NS_OK;
     }
   }
 
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-NS_IMETHODIMP
-nsXPLookAndFeel::LookAndFeelChanged()
+void
+nsXPLookAndFeel::RefreshImpl()
 {
   // Wipe out our color cache.
   PRUint32 i;
-  for (i = 0; i < nsILookAndFeel::eColor_LAST_COLOR; i++)
+  for (i = 0; i < eColorID_LAST_COLOR; i++)
     sCachedColors[i] = 0;
   for (i = 0; i < COLOR_CACHE_SIZE; i++)
     sCachedColorBits[i] = 0;
-  return NS_OK;
 }
 
-
-#ifdef DEBUG
-  // This method returns the actual (or nearest estimate) 
-  // of the Navigator size for a given form control for a given font
-  // and font size. This is used in NavQuirks mode to see how closely
-  // we match its size
-NS_IMETHODIMP
-nsXPLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                            const nsMetricNavFontID   aFontID, 
-                            const PRInt32             aFontSize, 
-                            nsSize &aSize)
-{
-  aSize.width  = 0;
-  aSize.height = 0;
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-#endif
-
 namespace mozilla {
 
 // static
 nsresult
 LookAndFeel::GetColor(ColorID aID, nscolor* aResult)
 {
-  NS_ENSURE_ARG_POINTER(aResult);
-  return nsLookAndFeel::GetInstance()->GetColor((nsILookAndFeel::nsColorID)aID, *aResult);
+  return nsLookAndFeel::GetInstance()->GetColorImpl(aID, *aResult);
 }
 
 // static
 nsresult
 LookAndFeel::GetInt(IntID aID, PRInt32* aResult)
 {
-  NS_ENSURE_ARG_POINTER(aResult);
-  return nsLookAndFeel::GetInstance()->GetMetric((nsILookAndFeel::nsMetricID)aID, *aResult);
+  return nsLookAndFeel::GetInstance()->GetIntImpl(aID, *aResult);
 }
 
 // static
 nsresult
 LookAndFeel::GetFloat(FloatID aID, float* aResult)
 {
-  NS_ENSURE_ARG_POINTER(aResult);
-  return nsLookAndFeel::GetInstance()->GetMetric((nsILookAndFeel::nsMetricFloatID)aID, *aResult);
+  return nsLookAndFeel::GetInstance()->GetFloatImpl(aID, *aResult);
 }
 
 // static
 PRUnichar
 LookAndFeel::GetPasswordCharacter()
 {
-  return nsLookAndFeel::GetInstance()->GetPasswordCharacter();
+  return nsLookAndFeel::GetInstance()->GetPasswordCharacterImpl();
 }
 
 // static
 PRBool
 LookAndFeel::GetEchoPassword()
 {
-  return nsLookAndFeel::GetInstance()->GetEchoPassword();
+  return nsLookAndFeel::GetInstance()->GetEchoPasswordImpl();
 }
 
 // static
 void
 LookAndFeel::Refresh()
 {
-  nsLookAndFeel::GetInstance()->LookAndFeelChanged();
+  nsLookAndFeel::GetInstance()->RefreshImpl();
 }
 
 } // namespace mozilla
--- a/widget/src/xpwidgets/nsXPLookAndFeel.h
+++ b/widget/src/xpwidgets/nsXPLookAndFeel.h
@@ -34,111 +34,103 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __nsXPLookAndFeel
 #define __nsXPLookAndFeel
 
 #include "mozilla/LookAndFeel.h"
-#include "nsCOMPtr.h"
-
-#ifdef NS_DEBUG
-struct nsSize;
-#endif
 
 class nsLookAndFeel;
 
-typedef enum {
-  nsLookAndFeelTypeInt,
-  nsLookAndFeelTypeFloat,
-  nsLookAndFeelTypeColor
-} nsLookAndFeelType;
-
 struct nsLookAndFeelIntPref
 {
   const char* name;
-  nsILookAndFeel::nsMetricID id;
+  mozilla::LookAndFeel::IntID id;
   PRPackedBool isSet;
-  nsLookAndFeelType type;
   PRInt32 intVar;
 };
 
 struct nsLookAndFeelFloatPref
 {
   const char* name;
-  nsILookAndFeel::nsMetricFloatID id;
+  mozilla::LookAndFeel::FloatID id;
   PRPackedBool isSet;
-  nsLookAndFeelType type;
   float floatVar;
 };
 
 #define CACHE_BLOCK(x)     ((x) >> 5)
 #define CACHE_BIT(x)       (1 << ((x) & 31))
 
-#define COLOR_CACHE_SIZE   (CACHE_BLOCK(nsILookAndFeel::eColor_LAST_COLOR) + 1)
+#define COLOR_CACHE_SIZE   (CACHE_BLOCK(LookAndFeel::eColorID_LAST_COLOR) + 1)
 #define IS_COLOR_CACHED(x) (CACHE_BIT(x) & nsXPLookAndFeel::sCachedColorBits[CACHE_BLOCK(x)])
 #define CLEAR_COLOR_CACHE(x) nsXPLookAndFeel::sCachedColors[(x)] =0; \
               nsXPLookAndFeel::sCachedColorBits[CACHE_BLOCK(x)] &= ~(CACHE_BIT(x));
 #define CACHE_COLOR(x, y)  nsXPLookAndFeel::sCachedColors[(x)] = y; \
               nsXPLookAndFeel::sCachedColorBits[CACHE_BLOCK(x)] |= CACHE_BIT(x);
 
-class nsXPLookAndFeel: public nsILookAndFeel
+class nsXPLookAndFeel: public mozilla::LookAndFeel
 {
 public:
-  nsXPLookAndFeel();
   virtual ~nsXPLookAndFeel();
 
-  NS_DECL_ISUPPORTS
-
-  static nsLookAndFeel* GetAddRefedInstance();
   static nsLookAndFeel* GetInstance();
   static void Shutdown();
 
   void Init();
 
   //
   // All these routines will return NS_OK if they have a value,
   // in which case the nsLookAndFeel should use that value;
   // otherwise we'll return NS_ERROR_NOT_AVAILABLE, in which case, the
   // platform-specific nsLookAndFeel should use its own values instead.
   //
-  NS_IMETHOD GetColor(const nsColorID aID, nscolor &aColor);
-  NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
-  NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
+  nsresult GetColorImpl(ColorID aID, nscolor &aResult);
+  virtual nsresult GetIntImpl(IntID aID, PRInt32 &aResult);
+  virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
 
-  NS_IMETHOD LookAndFeelChanged();
+  virtual void RefreshImpl();
 
-#ifdef NS_DEBUG
-  NS_IMETHOD GetNavSize(const nsMetricNavWidgetID aWidgetID,
-                        const nsMetricNavFontID   aFontID, 
-                        const PRInt32             aFontSize, 
-                        nsSize &aSize);
+  virtual PRUnichar GetPasswordCharacterImpl()
+  {
+    return PRUnichar('*');
+  }
+
+  virtual PRBool GetEchoPasswordImpl()
+  {
+#ifdef MOZ_GFX_OPTIMIZE_MOBILE
+    return PR_TRUE;
+#else
+    return PR_FALSE;
 #endif
+  }
 
 protected:
+  nsXPLookAndFeel();
+
   static void IntPrefChanged(nsLookAndFeelIntPref *data);
   static void FloatPrefChanged(nsLookAndFeelFloatPref *data);
   static void ColorPrefChanged(unsigned int index, const char *prefName);
   void InitFromPref(nsLookAndFeelIntPref* aPref);
   void InitFromPref(nsLookAndFeelFloatPref* aPref);
   void InitColorFromPref(PRInt32 aIndex);
-  virtual nsresult NativeGetColor(const nsColorID aID, nscolor& aColor) = 0;
-  PRBool IsSpecialColor(const nsColorID aID, nscolor &aColor);
+  virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) = 0;
+  PRBool IsSpecialColor(ColorID aID, nscolor &aColor);
 
   static int OnPrefChanged(const char* aPref, void* aClosure);
 
   static PRBool sInitialized;
   static nsLookAndFeelIntPref sIntPrefs[];
   static nsLookAndFeelFloatPref sFloatPrefs[];
   /* this length must not be shorter than the length of the longest string in the array
    * see nsXPLookAndFeel.cpp
    */
   static const char sColorPrefs[][38];
-  static PRInt32 sCachedColors[nsILookAndFeel::eColor_LAST_COLOR];
+  static PRInt32 sCachedColors[LookAndFeel::eColorID_LAST_COLOR];
   static PRInt32 sCachedColorBits[COLOR_CACHE_SIZE];
   static PRBool sUseNativeColors;
 
-  static nsXPLookAndFeel* sInstance;
+  static nsLookAndFeel* sInstance;
   static PRBool sShutdown;
 };
 
 #endif