Bug 836957 part 2: Remove unnecessary nsIFrame::GetSkipSides() overrides whose implementations are in .cpp files. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 04 Feb 2013 08:17:20 -0800
changeset 120764 2c6a7b66968f98d70ec2f1b94023972c64fa9056
parent 120763 69a6396e7d99a6fdf3c3f14d1286837bf14bb463
child 120765 b40b5c2a7592cb44717b5dd199ac9c6bacfe0677
push id22403
push userdholbert@mozilla.com
push dateMon, 04 Feb 2013 17:16:24 +0000
treeherdermozilla-inbound@b40b5c2a7592 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs836957
milestone21.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 836957 part 2: Remove unnecessary nsIFrame::GetSkipSides() overrides whose implementations are in .cpp files. r=mats
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsFileControlFrame.cpp
layout/forms/nsFileControlFrame.h
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
layout/generic/nsCanvasFrame.cpp
layout/generic/nsCanvasFrame.h
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsFirstLetterFrame.h
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsFrameSetFrame.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsSubDocumentFrame.h
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -84,17 +84,16 @@ public:
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const {
     return MakeFrameName(NS_LITERAL_STRING("FieldSet"), aResult);
   }
 #endif
 
 protected:
 
-  virtual int GetSkipSides() const;
   void ReparentFrameList(const nsFrameList& aFrameList);
 
   // mLegendFrame is a nsLegendFrame or a nsHTMLScrollFrame with the
   // nsLegendFrame as the scrolled frame (aka content insertion frame).
   nsIFrame* mLegendFrame;
   nsIFrame* mContentFrame;
   nsRect    mLegendRect;
   nscoord   mLegendSpace;
@@ -231,17 +230,16 @@ nsFieldSetFrame::BuildDisplayList(nsDisp
   contentDisplayItems.MoveTo(aLists);
   return NS_OK;
 }
 
 void
 nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
     nsPoint aPt, const nsRect& aDirtyRect, uint32_t aBGFlags)
 {
-  int skipSides = GetSkipSides();
   const nsStyleBorder* borderStyle = GetStyleBorder();
        
   nscoord topBorder = borderStyle->GetComputedBorderWidth(NS_SIDE_TOP);
   nscoord yoff = 0;
   nsPresContext* presContext = PresContext();
      
   // if the border is smaller than the legend. Move the border down
   // to be centered on the legend. 
@@ -270,52 +268,52 @@ nsFieldSetFrame::PaintBorderBackground(n
     // draw left side
     nsRect clipRect(rect);
     clipRect.width = legendRect.x - rect.x;
     clipRect.height = topBorder;
 
     aRenderingContext.PushState();
     aRenderingContext.IntersectClip(clipRect);
     nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
-                                aDirtyRect, rect, mStyleContext, skipSides);
+                                aDirtyRect, rect, mStyleContext);
 
     aRenderingContext.PopState();
 
 
     // draw right side
     clipRect = rect;
     clipRect.x = legendRect.XMost();
     clipRect.width = rect.XMost() - legendRect.XMost();
     clipRect.height = topBorder;
 
     aRenderingContext.PushState();
     aRenderingContext.IntersectClip(clipRect);
     nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
-                                aDirtyRect, rect, mStyleContext, skipSides);
+                                aDirtyRect, rect, mStyleContext);
 
     aRenderingContext.PopState();
 
     
     // draw bottom
     clipRect = rect;
     clipRect.y += topBorder;
     clipRect.height = mRect.height - (yoff + topBorder);
     
     aRenderingContext.PushState();
     aRenderingContext.IntersectClip(clipRect);
     nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
-                                aDirtyRect, rect, mStyleContext, skipSides);
+                                aDirtyRect, rect, mStyleContext);
 
     aRenderingContext.PopState();
   } else {
 
     nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
                                 aDirtyRect,
                                 nsRect(aPt, mRect.Size()),
-                                mStyleContext, skipSides);
+                                mStyleContext);
   }
 }
 
 nscoord
 nsFieldSetFrame::GetIntrinsicWidth(nsRenderingContext* aRenderingContext,
                                    nsLayoutUtils::IntrinsicWidthType aType)
 {
   nscoord legendWidth = 0;
@@ -576,22 +574,16 @@ nsFieldSetFrame::Reflow(nsPresContext*  
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
 
   InvalidateFrame();
 
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
   return NS_OK;
 }
 
-int
-nsFieldSetFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 NS_IMETHODIMP
 nsFieldSetFrame::AppendFrames(ChildListID    aListID,
                               nsFrameList&   aFrameList)
 {
   // aFrameList is not allowed to contain "the legend" for this fieldset
   ReparentFrameList(aFrameList);
   return mContentFrame->AppendFrames(aListID, aFrameList);
 }
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -467,22 +467,16 @@ nsFileControlFrame::GetMinWidth(nsRender
 
 nsTextControlFrame*
 nsFileControlFrame::GetTextControlFrame()
 {
   nsITextControlFrame* tc = do_QueryFrame(mTextContent->GetPrimaryFrame());
   return static_cast<nsTextControlFrame*>(tc);
 }
 
-int
-nsFileControlFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 void
 nsFileControlFrame::SyncAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              int32_t aWhichControls)
 {
   nsAutoString value;
   if (mContent->GetAttr(aNameSpaceID, aAttribute, value)) {
     if (aWhichControls & SYNC_TEXT && mTextContent) {
       mTextContent->SetAttr(aNameSpaceID, aAttribute, value, true);
--- a/layout/forms/nsFileControlFrame.h
+++ b/layout/forms/nsFileControlFrame.h
@@ -139,18 +139,16 @@ protected:
   };
 
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
   {
     return nsBlockFrame::IsFrameOfType(aFlags &
       ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
   }
 
-  virtual int GetSkipSides() const MOZ_OVERRIDE;
-
   /**
    * The text box input.
    * @see nsFileControlFrame::CreateAnonymousContent
    */
   nsCOMPtr<nsIContent> mTextContent;
   /**
    * The browse button input.
    * @see nsFileControlFrame::CreateAnonymousContent
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -317,22 +317,16 @@ nsHTMLButtonControlFrame::ReflowButtonCo
   if (aDesiredSize.ascent == nsHTMLReflowMetrics::ASK_FOR_BASELINE)
     aDesiredSize.ascent = aFirstKid->GetBaseline();
 
   // Adjust the baseline by our offset (since we moved the child's
   // baseline by that much).
   aDesiredSize.ascent += yoff;
 }
 
-int
-nsHTMLButtonControlFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 nsresult nsHTMLButtonControlFrame::SetFormProperty(nsIAtom* aName, const nsAString& aValue)
 {
   if (nsGkAtoms::value == aName) {
     return mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::value,
                              aValue, true);
   }
   return NS_OK;
 }
--- a/layout/forms/nsHTMLButtonControlFrame.h
+++ b/layout/forms/nsHTMLButtonControlFrame.h
@@ -104,17 +104,16 @@ protected:
   virtual bool IsInput() { return false; }
   void ReflowButtonContents(nsPresContext* aPresContext,
                             nsHTMLReflowMetrics& aDesiredSize,
                             const nsHTMLReflowState& aReflowState,
                             nsIFrame* aFirstKid,
                             nsMargin aFocusPadding,
                             nsReflowStatus& aStatus);
 
-  int GetSkipSides() const;
   nsButtonFrameRenderer mRenderer;
 };
 
 #endif
 
 
 
 
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1112,23 +1112,16 @@ NS_IMETHODIMP
 nsListControlFrame::OnOptionSelected(int32_t aIndex, bool aSelected)
 {
   if (aSelected) {
     ScrollToIndex(aIndex);
   }
   return NS_OK;
 }
 
-int
-nsListControlFrame::GetSkipSides() const
-{    
-    // Don't skip any sides during border rendering
-  return 0;
-}
-
 void
 nsListControlFrame::OnContentReset()
 {
   ResetList(true);
 }
 
 void 
 nsListControlFrame::ResetList(bool aAllowScrolling)
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -104,19 +104,16 @@ public:
   virtual nsGfxScrollFrameInner::ScrollbarStyles GetScrollbarStyles() const MOZ_OVERRIDE;
   virtual bool ShouldPropagateComputedHeightToScrolledContent() const MOZ_OVERRIDE;
 
     // for accessibility purposes
 #ifdef ACCESSIBILITY
   virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
 #endif
 
-    // nsContainerFrame
-  virtual int GetSkipSides() const MOZ_OVERRIDE;
-
     // nsIListControlFrame
   virtual void SetComboboxFrame(nsIFrame* aComboboxFrame);
   virtual int32_t GetSelectedIndex() MOZ_OVERRIDE;
   virtual already_AddRefed<nsIContent> GetCurrentOption() MOZ_OVERRIDE;
 
   /**
    * Gets the text of the currently selected item.
    * If the there are zero items then an empty string is returned
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -555,22 +555,16 @@ nsCanvasFrame::Reflow(nsPresContext*    
 
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
 
   NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus);
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
   return NS_OK;
 }
 
-int
-nsCanvasFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 nsIAtom*
 nsCanvasFrame::GetType() const
 {
   return nsGkAtoms::canvasFrame;
 }
 
 NS_IMETHODIMP 
 nsCanvasFrame::GetContentForEvent(nsEvent* aEvent,
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -104,18 +104,16 @@ public:
   NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
   NS_IMETHOD GetContentForEvent(nsEvent* aEvent,
                                 nsIContent** aContent) MOZ_OVERRIDE;
 
   nsRect CanvasArea() const;
 
 protected:
-  virtual int GetSkipSides() const;
-
   // Data members
   bool                      mDoPaintFocus;
   bool                      mAddedScrollPositionListener;
 };
 
 /**
  * Override nsDisplayBackground methods so that we pass aBGClipRect to
  * PaintBackground, covering the whole overflow area.
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -79,18 +79,16 @@ public:
     return MakeFrameName(NS_LITERAL_STRING("ColumnSet"), aResult);
   }
 #endif
 
 protected:
   nscoord        mLastBalanceHeight;
   nsReflowStatus mLastFrameStatus;
 
-  virtual int GetSkipSides() const;
-
   /**
    * These are the parameters that control the layout of columns.
    */
   struct ReflowConfig {
     int32_t mBalanceColCount;
     nscoord mColWidth;
     nscoord mExpectedWidthLeftOver;
     nscoord mColGap;
@@ -1100,22 +1098,16 @@ nsColumnSetFrame::BuildDisplayList(nsDis
   for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
     nsresult rv = BuildDisplayListForChild(aBuilder, e.get(),
                                            aDirtyRect, aLists);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
 
-int
-nsColumnSetFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 NS_IMETHODIMP
 nsColumnSetFrame::AppendFrames(ChildListID     aListID,
                                nsFrameList&    aFrameList)
 {
   NS_NOTREACHED("AppendFrames not supported");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -41,22 +41,16 @@ nsFirstLetterFrame::GetFrameName(nsAStri
 #endif
 
 nsIAtom*
 nsFirstLetterFrame::GetType() const
 {
   return nsGkAtoms::letterFrame;
 }
 
-int
-nsFirstLetterFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 NS_IMETHODIMP
 nsFirstLetterFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                      const nsRect&           aDirtyRect,
                                      const nsDisplayListSet& aLists)
 {
   return BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
 }
 
--- a/layout/generic/nsFirstLetterFrame.h
+++ b/layout/generic/nsFirstLetterFrame.h
@@ -76,14 +76,12 @@ public:
   nsresult CreateContinuationForFloatingParent(nsPresContext* aPresContext,
                                                nsIFrame* aChild,
                                                nsIFrame** aContinuation,
                                                bool aIsFluid);
 
 protected:
   nscoord mBaseline;
 
-  virtual int GetSkipSides() const;
-
   void DrainOverflowFrames(nsPresContext* aPresContext);
 };
 
 #endif /* nsFirstLetterFrame_h__ */
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -651,23 +651,16 @@ int32_t nsHTMLFramesetFrame::GetBorderWi
   if (mParentBorderWidth > 0 ||
       (mParentBorderWidth == 0 && !forcing)) {
     return mParentBorderWidth;
   }
 
   return nsPresContext::CSSPixelsToAppUnits(DEFAULT_BORDER_WIDTH_PX);
 }
 
-
-int
-nsHTMLFramesetFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 void
 nsHTMLFramesetFrame::GetDesiredSize(nsPresContext*           aPresContext,
                                     const nsHTMLReflowState& aReflowState,
                                     nsHTMLReflowMetrics&     aDesiredSize)
 {
   nsHTMLFramesetFrame* framesetParent = do_QueryFrame(GetParent());
   if (nullptr == framesetParent) {
     if (aPresContext->IsPaginated()) {
--- a/layout/generic/nsFrameSetFrame.h
+++ b/layout/generic/nsFrameSetFrame.h
@@ -173,18 +173,16 @@ protected:
   nsFrameborder GetFrameBorder(nsIContent* aContent);
 
   nscolor GetBorderColor();
 
   nscolor GetBorderColor(nsIContent* aFrameContent);
 
   bool GetNoResize(nsIFrame* aChildFrame); 
   
-  virtual int GetSkipSides() const;
-
   void ReflowPlaceChild(nsIFrame*                aChild,
                         nsPresContext*          aPresContext,
                         const nsHTMLReflowState& aReflowState,
                         nsPoint&                 aOffset,
                         nsSize&                  aSize,
                         nsIntPoint*              aCellIndex = 0);
   
   bool CanResize(bool aVertical, bool aLeft); 
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -141,22 +141,16 @@ nsHTMLScrollFrame::RemoveFrame(ChildList
 }
 
 nsSplittableType
 nsHTMLScrollFrame::GetSplittableType() const
 {
   return NS_FRAME_NOT_SPLITTABLE;
 }
 
-int
-nsHTMLScrollFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 nsIAtom*
 nsHTMLScrollFrame::GetType() const
 {
   return nsGkAtoms::scrollFrame; 
 }
 
 /**
  HTML scrolling implementation
@@ -985,22 +979,16 @@ nsXULScrollFrame::GetSplittableType() co
 
 NS_IMETHODIMP
 nsXULScrollFrame::GetPadding(nsMargin& aMargin)
 {
    aMargin.SizeTo(0,0,0,0);
    return NS_OK;
 }
 
-int
-nsXULScrollFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 nsIAtom*
 nsXULScrollFrame::GetType() const
 {
   return nsGkAtoms::scrollFrame; 
 }
 
 nscoord
 nsXULScrollFrame::GetBoxAscent(nsBoxLayoutState& aState)
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -557,18 +557,16 @@ public:
   bool DidHistoryRestore() { return mInner.mDidHistoryRestore; }
 
 #ifdef ACCESSIBILITY
   virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
 #endif
 
 protected:
   nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot);
-  virtual int GetSkipSides() const;
-  
   void SetSuppressScrollbarUpdate(bool aSuppress) {
     mInner.mSupppressScrollbarUpdate = aSuppress;
   }
   bool GuessHScrollbarNeeded(const ScrollReflowState& aState);
   bool GuessVScrollbarNeeded(const ScrollReflowState& aState);
 
   bool IsScrollbarUpdateSuppressed() const {
     return mInner.mSupppressScrollbarUpdate;
@@ -812,17 +810,16 @@ public:
   }
 
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
 
 protected:
   nsXULScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot);
-  virtual int GetSkipSides() const;
 
   void ClampAndSetBounds(nsBoxLayoutState& aState, 
                          nsRect& aRect,
                          nsPoint aScrollPosition,
                          bool aRemoveOverflowAreas = false) {
     /* 
      * For RTL frames, restore the original scrolled position of the right
      * edge, then subtract the current width to find the physical position.
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -216,22 +216,16 @@ nsSubDocumentFrame::ShowViewer()
         return;
       }
       mCallingShow = false;
       mDidCreateDoc = didCreateDoc;
     }
   }
 }
 
-int
-nsSubDocumentFrame::GetSkipSides() const
-{
-  return 0;
-}
-
 nsIFrame*
 nsSubDocumentFrame::GetSubdocumentRootFrame()
 {
   if (!mInnerView)
     return nullptr;
   nsView* subdocView = mInnerView->GetFirstChild();
   return subdocView ? subdocView->GetFrame() : nullptr;
 }
--- a/layout/generic/nsSubDocumentFrame.h
+++ b/layout/generic/nsSubDocumentFrame.h
@@ -115,18 +115,16 @@ protected:
 
   nsFrameLoader* FrameLoader();
 
   bool IsInline() { return mIsInline; }
 
   virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE;
   virtual nscoord GetIntrinsicHeight() MOZ_OVERRIDE;
 
-  virtual int GetSkipSides() const;
-
   // Show our document viewer. The document viewer is hidden via a script
   // runner, so that we can save and restore the presentation if we're
   // being reframed.
   void ShowViewer();
 
   /* Obtains the frame we should use for intrinsic size information if we are
    * an HTML <object>, <embed> or <applet> (a replaced element - not <iframe>)
    * and our sub-document has an intrinsic size. The frame returned is the