Bug 871264 - Remove the aPresContext and aFrame parameters from ThemeDrawsFocusForWidget. r=dholbert, sr=roc
authorJonathan Watt <jwatt@jwatt.org>
Tue, 14 May 2013 00:47:03 +0100
changeset 138993 7e5f9688566c18f8cd07b1a79f296eb79e6cd4b2
parent 138992 6115fce2399d49005d2e53660a4ba8f8fa337405
child 138994 49aabddb2edba64546f096957c63fe7934c929b3
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, roc
bugs871264
milestone24.0a1
Bug 871264 - Remove the aPresContext and aFrame parameters from ThemeDrawsFocusForWidget. r=dholbert, sr=roc
gfx/src/nsITheme.h
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsRangeFrame.cpp
widget/cocoa/nsNativeThemeCocoa.h
widget/cocoa/nsNativeThemeCocoa.mm
widget/gtk2/nsNativeThemeGTK.cpp
widget/gtk2/nsNativeThemeGTK.h
widget/qt/nsNativeThemeQt.cpp
widget/qt/nsNativeThemeQt.h
widget/windows/nsNativeThemeWin.cpp
widget/windows/nsNativeThemeWin.h
--- a/gfx/src/nsITheme.h
+++ b/gfx/src/nsITheme.h
@@ -148,19 +148,17 @@ public:
                                      nsIFrame* aFrame,
                                      uint8_t aWidgetType)=0;
 
   virtual bool WidgetIsContainer(uint8_t aWidgetType)=0;
 
   /**
    * Does the nsITheme implementation draw its own focus ring for this widget?
    */
-  virtual bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
-                                          nsIFrame* aFrame,
-                                          uint8_t aWidgetType)=0;
+  virtual bool ThemeDrawsFocusForWidget(uint8_t aWidgetType)=0;
   
   /**
     * Should we insert a dropmarker inside of combobox button?
    */
   virtual bool ThemeNeedsComboboxDropmarker()=0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -163,17 +163,17 @@ void nsDisplayButtonBorderBackground::Pa
 }
 
 void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
                                       nsRenderingContext* aCtx)
 {
   nsPresContext *presContext = mFrame->PresContext();
   const nsStyleDisplay *disp = mFrame->StyleDisplay();
   if (!mFrame->IsThemed(disp) ||
-      !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, mFrame, disp->mAppearance)) {
+      !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) {
     // draw the focus and outline borders
     nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
     mBFR->PaintOutlineAndFocusBorders(presContext, *aCtx, mVisibleRect, r);
   }
 }
 
 nsresult
 nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1531,17 +1531,17 @@ nsComboboxControlFrame::BuildDisplayList
   // draw a focus indicator only when focus rings should be drawn
   nsIDocument* doc = mContent->GetCurrentDoc();
   if (doc) {
     nsPIDOMWindow* window = doc->GetWindow();
     if (window && window->ShouldShowFocusRing()) {
       nsPresContext *presContext = PresContext();
       const nsStyleDisplay *disp = StyleDisplay();
       if ((!IsThemed(disp) ||
-           !presContext->GetTheme()->ThemeDrawsFocusForWidget(presContext, this, disp->mAppearance)) &&
+           !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
           mDisplayFrame && IsVisibleForPainting(aBuilder)) {
         aLists.Content()->AppendNewToTop(
           new (aBuilder) nsDisplayComboboxFocus(aBuilder, this));
       }
     }
   }
 
   DisplaySelectionOverlay(aBuilder, aLists.Content());
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -239,18 +239,17 @@ nsRangeFrame::BuildDisplayList(nsDisplay
   nsEventStates eventStates = mContent->AsElement()->State();
   if (!eventStates.HasState(NS_EVENT_STATE_FOCUSRING) ||
       eventStates.HasState(NS_EVENT_STATE_DISABLED)) {
     return;
   }
   nsPresContext *presContext = PresContext();
   const nsStyleDisplay *disp = StyleDisplay();
   if ((!IsThemed(disp) ||
-       !presContext->GetTheme()->
-         ThemeDrawsFocusForWidget(presContext, this, disp->mAppearance)) &&
+       !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) &&
       IsVisibleForPainting(aBuilder)) {
     aLists.Content()->AppendNewToTop(
       new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
   }
 }
 
 NS_IMETHODIMP
 nsRangeFrame::Reflow(nsPresContext*           aPresContext,
--- a/widget/cocoa/nsNativeThemeCocoa.h
+++ b/widget/cocoa/nsNativeThemeCocoa.h
@@ -52,17 +52,17 @@ public:
   NS_IMETHOD GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* aFrame,
                                   uint8_t aWidgetType,
                                   nsIntSize* aResult, bool* aIsOverridable);
   NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType, 
                                 nsIAtom* aAttribute, bool* aShouldRepaint);
   NS_IMETHOD ThemeChanged();
   bool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
   bool WidgetIsContainer(uint8_t aWidgetType);
-  bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
+  bool ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
   bool ThemeNeedsComboboxDropmarker();
   virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType);
 
   void DrawProgress(CGContextRef context, const HIRect& inBoxRect,
                     bool inIsIndeterminate, bool inIsHorizontal,
                     double inValue, double inMaxValue, nsIFrame* aFrame);
 
 protected:  
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -3063,17 +3063,17 @@ nsNativeThemeCocoa::WidgetIsContainer(ui
    case NS_THEME_RANGE:
     return false;
     break;
   }
   return true;
 }
 
 bool
-nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeCocoa::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
   if (aWidgetType == NS_THEME_DROPDOWN ||
       aWidgetType == NS_THEME_DROPDOWN_TEXTFIELD ||
       aWidgetType == NS_THEME_BUTTON ||
       aWidgetType == NS_THEME_RADIO ||
       aWidgetType == NS_THEME_RANGE ||
       aWidgetType == NS_THEME_CHECKBOX)
     return true;
--- a/widget/gtk2/nsNativeThemeGTK.cpp
+++ b/widget/gtk2/nsNativeThemeGTK.cpp
@@ -1445,17 +1445,17 @@ nsNativeThemeGTK::WidgetIsContainer(uint
       aWidgetType == NS_THEME_BUTTON_ARROW_DOWN ||
       aWidgetType == NS_THEME_BUTTON_ARROW_NEXT ||
       aWidgetType == NS_THEME_BUTTON_ARROW_PREVIOUS)
     return false;
   return true;
 }
 
 bool
-nsNativeThemeGTK::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeGTK::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
    if (aWidgetType == NS_THEME_DROPDOWN ||
       aWidgetType == NS_THEME_BUTTON || 
       aWidgetType == NS_THEME_TREEVIEW_HEADER_CELL)
     return true;
   
   return false;
 }
--- a/widget/gtk2/nsNativeThemeGTK.h
+++ b/widget/gtk2/nsNativeThemeGTK.h
@@ -49,18 +49,17 @@ public:
   NS_IMETHOD ThemeChanged();
 
   NS_IMETHOD_(bool) ThemeSupportsWidget(nsPresContext* aPresContext,
                                           nsIFrame* aFrame,
                                           uint8_t aWidgetType);
 
   NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType);
   
-  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
-                                               nsIFrame* aFrame, uint8_t aWidgetType);
+  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
 
   bool ThemeNeedsComboboxDropmarker();
 
   virtual Transparency GetWidgetTransparency(nsIFrame* aFrame,
                                              uint8_t aWidgetType);
 
   nsNativeThemeGTK();
   virtual ~nsNativeThemeGTK();
--- a/widget/qt/nsNativeThemeQt.cpp
+++ b/widget/qt/nsNativeThemeQt.cpp
@@ -570,17 +570,17 @@ nsNativeThemeQt::WidgetIsContainer(uint8
 //         aWidgetType == NS_THEME_CHECKBOX) {
 //         return false;
 //     }
 
    return true;
 }
 
 bool
-nsNativeThemeQt::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeQt::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
     if (aWidgetType == NS_THEME_DROPDOWN ||
         aWidgetType == NS_THEME_BUTTON || 
         aWidgetType == NS_THEME_TREEVIEW_HEADER_CELL) { 
         return true;
     }
 
     return false;
--- a/widget/qt/nsNativeThemeQt.h
+++ b/widget/qt/nsNativeThemeQt.h
@@ -53,18 +53,17 @@ public:
 
   bool WidgetIsContainer(uint8_t aWidgetType);
 
   virtual NS_HIDDEN_(bool) GetWidgetPadding(nsDeviceContext* aContext,
                                               nsIFrame* aFrame,
                                               uint8_t aWidgetType,
                                               nsIntMargin* aResult);
 
-  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
-                                               nsIFrame* aFrame, uint8_t aWidgetType);
+  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
 
   bool ThemeNeedsComboboxDropmarker();
 
   nsNativeThemeQt();
   virtual ~nsNativeThemeQt();
 
 private:
 
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -2577,17 +2577,17 @@ nsNativeThemeWin::WidgetIsContainer(uint
   if (aWidgetType == NS_THEME_DROPDOWN_BUTTON || 
       aWidgetType == NS_THEME_RADIO ||
       aWidgetType == NS_THEME_CHECKBOX)
     return false;
   return true;
 }
 
 bool
-nsNativeThemeWin::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType)
+nsNativeThemeWin::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
   return false;
 }
 
 bool
 nsNativeThemeWin::ThemeNeedsComboboxDropmarker()
 {
   return true;
--- a/widget/windows/nsNativeThemeWin.h
+++ b/widget/windows/nsNativeThemeWin.h
@@ -58,17 +58,17 @@ public:
   NS_IMETHOD ThemeChanged();
 
   bool ThemeSupportsWidget(nsPresContext* aPresContext, 
                              nsIFrame* aFrame,
                              uint8_t aWidgetType);
 
   bool WidgetIsContainer(uint8_t aWidgetType);
 
-  bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
+  bool ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
 
   bool ThemeNeedsComboboxDropmarker();
 
   nsNativeThemeWin();
   virtual ~nsNativeThemeWin();
 
 protected:
   HANDLE GetTheme(uint8_t aWidgetType);