clean up unused methods and virualized methods in nsButtonFrameRenderer. Patch by Rob Arnold. b=315347 r/sr=roc
authorjoshmoz@gmail.com
Wed, 23 May 2007 13:32:56 -0700
changeset 1799 35a0a553e365904970b1be23fcbf91bf14688e13
parent 1798 0a80ffb1748606bb22ea074648b9288b4e5e2a78
child 1800 b27874055f04117f22abff04539dca4271574c6e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs315347
milestone1.9a5pre
clean up unused methods and virualized methods in nsButtonFrameRenderer. Patch by Rob Arnold. b=315347 r/sr=roc
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsButtonFrameRenderer.h
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -226,24 +226,16 @@ nsButtonFrameRenderer::PaintBorderAndBac
                                   aDirtyRect, buttonRect, *border, *padding,
                                   PR_FALSE);
   nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
                               aDirtyRect, buttonRect, *border, context, 0);
 }
 
 
 void
-nsButtonFrameRenderer::GetButtonOutlineRect(const nsRect& aRect, nsRect& outlineRect)
-{
-  outlineRect = aRect;
-  outlineRect.Inflate(GetButtonOutlineBorderAndPadding());
-}
-
-
-void
 nsButtonFrameRenderer::GetButtonOuterFocusRect(const nsRect& aRect, nsRect& focusRect)
 {
   focusRect = aRect;
 }
 
 void
 nsButtonFrameRenderer::GetButtonRect(const nsRect& aRect, nsRect& r)
 {
@@ -255,23 +247,16 @@ nsButtonFrameRenderer::GetButtonRect(con
 void
 nsButtonFrameRenderer::GetButtonInnerFocusRect(const nsRect& aRect, nsRect& focusRect)
 {
   GetButtonRect(aRect, focusRect);
   focusRect.Deflate(GetButtonBorderAndPadding());
   focusRect.Deflate(GetButtonInnerFocusMargin());
 }
 
-void
-nsButtonFrameRenderer::GetButtonContentRect(const nsRect& aRect, nsRect& r)
-{
-  GetButtonInnerFocusRect(aRect, r);
-  r.Deflate(GetButtonInnerFocusBorderAndPadding());
-}
-
 
 nsMargin
 nsButtonFrameRenderer::GetButtonOuterFocusBorderAndPadding()
 {
   nsMargin result(0,0,0,0);
 
   if (mOuterFocusStyle) {
     if (!mOuterFocusStyle->GetStylePadding()->GetPadding(result)) {
@@ -341,17 +326,17 @@ nsMargin
 nsButtonFrameRenderer::GetAddedButtonBorderAndPadding()
 {
   return GetButtonOuterFocusBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
 }
 
 /**
  * Call this when styles change
  */
-void 
+void
 nsButtonFrameRenderer::ReResolveStyles(nsPresContext* aPresContext)
 {
   // get all the styles
   nsStyleContext* context = mFrame->GetStyleContext();
   nsStyleSet *styleSet = aPresContext->StyleSet();
 
   // style for the inner such as a dotted line (Windows)
   mInnerFocusStyle = styleSet->ProbePseudoStyleFor(mFrame->GetContent(),
--- a/layout/forms/nsButtonFrameRenderer.h
+++ b/layout/forms/nsButtonFrameRenderer.h
@@ -52,69 +52,67 @@ class nsStyleChangeList;
 
 #define NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX  0
 #define NS_BUTTON_RENDERER_FOCUS_OUTER_CONTEXT_INDEX  1
 #define NS_BUTTON_RENDERER_LAST_CONTEXT_INDEX   NS_BUTTON_RENDERER_FOCUS_OUTER_CONTEXT_INDEX
 
 class nsButtonFrameRenderer {
 public:
 
-         nsButtonFrameRenderer();
-   virtual ~nsButtonFrameRenderer();
+  nsButtonFrameRenderer();
+  ~nsButtonFrameRenderer();
 
-   /**
-    * Create display list items for the button
-    */
-   nsresult DisplayButton(nsDisplayListBuilder* aBuilder,
-                          nsDisplayList* aBackground, nsDisplayList* aForeground);
+  /**
+   * Create display list items for the button
+   */
+  nsresult DisplayButton(nsDisplayListBuilder* aBuilder,
+                         nsDisplayList* aBackground, nsDisplayList* aForeground);
 
 
-        void PaintOutlineAndFocusBorders(nsPresContext* aPresContext,
-						  nsIRenderingContext& aRenderingContext,
-						  const nsRect& aDirtyRect,
-						  const nsRect& aRect);
+  void PaintOutlineAndFocusBorders(nsPresContext* aPresContext,
+                                   nsIRenderingContext& aRenderingContext,
+                                   const nsRect& aDirtyRect,
+                                   const nsRect& aRect);
 
-        void PaintBorderAndBackground(nsPresContext* aPresContext,
-						  nsIRenderingContext& aRenderingContext,
-						  const nsRect& aDirtyRect,
-						  const nsRect& aRect);
+  void PaintBorderAndBackground(nsPresContext* aPresContext,
+                                nsIRenderingContext& aRenderingContext,
+                                const nsRect& aDirtyRect,
+                                const nsRect& aRect);
 
-	virtual void SetFrame(nsFrame* aFrame, nsPresContext* aPresContext);
+  void SetFrame(nsFrame* aFrame, nsPresContext* aPresContext);
  
-	virtual void SetDisabled(PRBool aDisabled, PRBool notify);
+  void SetDisabled(PRBool aDisabled, PRBool notify);
 
-	PRBool isActive();
-	PRBool isDisabled();
+  PRBool isActive();
+  PRBool isDisabled();
 
-	virtual void GetButtonOutlineRect(const nsRect& aRect, nsRect& aResult);
-	virtual void GetButtonOuterFocusRect(const nsRect& aRect, nsRect& aResult);
-	virtual void GetButtonRect(const nsRect& aRect, nsRect& aResult);
-	virtual void GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aResult);
-	virtual void GetButtonContentRect(const nsRect& aRect, nsRect& aResult);
-  virtual nsMargin GetButtonOuterFocusBorderAndPadding();
-  virtual nsMargin GetButtonBorderAndPadding();
-  virtual nsMargin GetButtonInnerFocusMargin();
-  virtual nsMargin GetButtonInnerFocusBorderAndPadding();
-  virtual nsMargin GetButtonOutlineBorderAndPadding();
-  virtual nsMargin GetFullButtonBorderAndPadding();
-  virtual nsMargin GetAddedButtonBorderAndPadding();
+  void GetButtonOuterFocusRect(const nsRect& aRect, nsRect& aResult);
+  void GetButtonRect(const nsRect& aRect, nsRect& aResult);
+  void GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aResult);
+  nsMargin GetButtonOuterFocusBorderAndPadding();
+  nsMargin GetButtonBorderAndPadding();
+  nsMargin GetButtonInnerFocusMargin();
+  nsMargin GetButtonInnerFocusBorderAndPadding();
+  nsMargin GetButtonOutlineBorderAndPadding();
+  nsMargin GetFullButtonBorderAndPadding();
+  nsMargin GetAddedButtonBorderAndPadding();
 
-  virtual nsStyleContext* GetStyleContext(PRInt32 aIndex) const;
-  virtual void SetStyleContext(PRInt32 aIndex, nsStyleContext* aStyleContext);
-	virtual void ReResolveStyles(nsPresContext* aPresContext);
+  nsStyleContext* GetStyleContext(PRInt32 aIndex) const;
+  void SetStyleContext(PRInt32 aIndex, nsStyleContext* aStyleContext);
+  void ReResolveStyles(nsPresContext* aPresContext);
 
-  virtual nsIFrame* GetFrame();
+  nsIFrame* GetFrame();
 
 protected:
 
 private:
 
-	// cached styles for focus and outline.
+  // cached styles for focus and outline.
   nsRefPtr<nsStyleContext> mBorderStyle;
   nsRefPtr<nsStyleContext> mInnerFocusStyle;
   nsRefPtr<nsStyleContext> mOuterFocusStyle;
 
-	nsFrame* mFrame;
+  nsFrame* mFrame;
 };
 
 
 #endif