Bug 487831: Remove nsBox::(Get|Set)WasCollapsed, which are totally unused. r+sr=dbaron
authorZack Weinberg <zweinberg@mozilla.com>
Fri, 10 Apr 2009 13:29:50 -0700
changeset 27199 7030a020fed0e1630db51c0a6de4516719449607
parent 27198 470dc2aa4169ffb24dfe7272881c0753184ca3a9
child 27200 374ed6b2fd1a7c60ed2fef32de00176519c1431e
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)
bugs487831
milestone1.9.2a1pre
Bug 487831: Remove nsBox::(Get|Set)WasCollapsed, which are totally unused. r+sr=dbaron
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/xul/base/src/nsBox.cpp
layout/xul/base/src/nsBox.h
layout/xul/base/src/nsBoxFrame.cpp
layout/xul/base/src/nsBoxFrame.h
layout/xul/base/src/nsLeafBoxFrame.cpp
layout/xul/base/src/nsLeafBoxFrame.h
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -141,18 +141,16 @@ struct nsBoxLayoutMetrics
   nsSize mBlockMinSize;
   nsSize mBlockPrefSize;
   nscoord mBlockAscent;
 
   nscoord mFlex;
   nscoord mAscent;
 
   nsSize mLastSize;
-
-  PRPackedBool mWasCollapsed;
 };
 
 struct nsContentAndOffset
 {
   nsIContent* mContent;
   PRInt32 mOffset;
 };
 
@@ -6760,28 +6758,16 @@ nsFrame::BoxReflow(nsBoxLayoutState&    
 
 #ifdef DEBUG_REFLOW
   gIndent2--;
 #endif
 
   return NS_OK;
 }
 
-PRBool
-nsFrame::GetWasCollapsed(nsBoxLayoutState& aState)
-{
-  return BoxMetrics()->mWasCollapsed;
-}
-
-void
-nsFrame::SetWasCollapsed(nsBoxLayoutState& aState, PRBool aCollapsed)
-{
-  BoxMetrics()->mWasCollapsed = aCollapsed;
-}
-
 nsBoxLayoutMetrics*
 nsFrame::BoxMetrics() const
 {
   nsBoxLayoutMetrics* metrics =
     static_cast<nsBoxLayoutMetrics*>(GetProperty(nsGkAtoms::boxMetricsProperty));
   NS_ASSERTION(metrics, "A box layout method was called but InitBoxMetrics was never called");
   return metrics;
 }
@@ -6824,17 +6810,16 @@ nsFrame::InitBoxMetrics(PRBool aClear)
     DeleteProperty(nsGkAtoms::boxMetricsProperty);
 
   nsBoxLayoutMetrics *metrics = new nsBoxLayoutMetrics();
   SetProperty(nsGkAtoms::boxMetricsProperty, metrics, DeleteBoxMetrics);
 
   nsFrame::MarkIntrinsicWidthsDirty();
   metrics->mBlockAscent = 0;
   metrics->mLastSize.SizeTo(0, 0);
-  metrics->mWasCollapsed = PR_FALSE;
 }
 
 // Box layout debugging
 #ifdef DEBUG_REFLOW
 PRInt32 gIndent2 = 0;
 
 void
 nsAdaptorAddIndents()
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -593,19 +593,16 @@ protected:
   static void FillCursorInformationFromStyle(const nsStyleUserInterface* ui,
                                              nsIFrame::Cursor& aCursor);
   NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
 
 #ifdef DEBUG_LAYOUT
   virtual void GetBoxName(nsAutoString& aName);
 #endif
 
-  virtual PRBool GetWasCollapsed(nsBoxLayoutState& aState);
-  virtual void SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas);
-
   void InitBoxMetrics(PRBool aClear);
   nsBoxLayoutMetrics* BoxMetrics() const;
 
   // Fire DOM event. If no aContent argument use frame's mContent.
   void FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent = nsnull);
 
 private:
   nsresult BoxReflow(nsBoxLayoutState& aState,
--- a/layout/xul/base/src/nsBox.cpp
+++ b/layout/xul/base/src/nsBox.cpp
@@ -416,31 +416,16 @@ nsBox::DoesNeedRecalc(const nsSize& aSiz
 }
 
 PRBool
 nsBox::DoesNeedRecalc(nscoord aCoord)
 {
   return (aCoord == -1);
 }
 
-PRBool
-nsBox::GetWasCollapsed(nsBoxLayoutState& aState)
-{
-  return (GetStateBits() & NS_STATE_IS_COLLAPSED) != 0;
-}
-
-void
-nsBox::SetWasCollapsed(nsBoxLayoutState& aState, PRBool aCollapsed)
-{
-  if (aCollapsed)
-     AddStateBits(NS_STATE_IS_COLLAPSED);
-  else
-     RemoveStateBits(NS_STATE_IS_COLLAPSED);
-}
-
 NS_IMETHODIMP
 nsBox::SetLayoutManager(nsIBoxLayout* aLayout)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBox::GetLayoutManager(nsIBoxLayout** aLayout)
--- a/layout/xul/base/src/nsBox.h
+++ b/layout/xul/base/src/nsBox.h
@@ -124,18 +124,16 @@ rollbox.
 protected:
 
 #ifdef DEBUG_LAYOUT
   virtual void AppendAttribute(const nsAutoString& aAttribute, const nsAutoString& aValue, nsAutoString& aResult);
 
   virtual void ListBox(nsAutoString& aResult);
 #endif
   
-  virtual PRBool GetWasCollapsed(nsBoxLayoutState& aState);
-  virtual void SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas);
   virtual PRBool GetDefaultFlex(PRInt32& aFlex);
   virtual void GetLayoutFlags(PRUint32& aFlags);
 
   NS_HIDDEN_(nsresult) BeginLayout(nsBoxLayoutState& aState);
   NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
   NS_HIDDEN_(nsresult) EndLayout(nsBoxLayoutState& aState);
 
 #ifdef DEBUG_LAYOUT
--- a/layout/xul/base/src/nsBoxFrame.cpp
+++ b/layout/xul/base/src/nsBoxFrame.cpp
@@ -2138,28 +2138,16 @@ nsBoxFrame::RelayoutChildAtOrdinal(nsBox
     mFrames.SetFrames(aChild);
   }
 
   aChild->SetNextSibling(newNextSib);
 
   return NS_OK;
 }
 
-PRBool
-nsBoxFrame::GetWasCollapsed(nsBoxLayoutState& aState)
-{
-  return nsBox::GetWasCollapsed(aState);
-}
-
-void
-nsBoxFrame::SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas)
-{
-  nsBox::SetWasCollapsed(aState, aWas);
-}
-
 /**
  * This wrapper class lets us redirect mouse hits from descendant frames
  * of a menu to the menu itself, if they didn't specify 'allowevents'.
  * 
  * The wrapper simply turns a hit on a descendant element
  * into a hit on the menu itself, unless there is an element between the target
  * and the menu with the "allowevents" attribute.
  * 
--- a/layout/xul/base/src/nsBoxFrame.h
+++ b/layout/xul/base/src/nsBoxFrame.h
@@ -54,17 +54,17 @@ class nsBoxLayoutState;
 #define NS_STATE_BOX_CHILD_RESERVED      0x00100000
 #define NS_STATE_STACK_NOT_POSITIONED    0x00200000
 //#define NS_STATE_IS_HORIZONTAL           0x00400000  moved to nsIFrame.h
 #define NS_STATE_AUTO_STRETCH            0x00800000
 //#define NS_STATE_IS_ROOT                 0x01000000  moved to nsBox.h
 #define NS_STATE_CURRENTLY_IN_DEBUG      0x02000000
 //#define NS_STATE_SET_TO_DEBUG            0x04000000  moved to nsBox.h
 //#define NS_STATE_DEBUG_WAS_SET           0x08000000  moved to nsBox.h
-#define NS_STATE_IS_COLLAPSED            0x10000000
+//                                         0x10000000  not used anymore
 #define NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK 0x20000000
 #define NS_STATE_EQUAL_SIZE              0x40000000
 //#define NS_STATE_IS_DIRECTION_NORMAL     0x80000000  moved to nsIFrame.h
 
 nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
                          nsStyleContext* aContext,
                          PRBool aIsRoot,
                          nsIBoxLayout* aLayoutManager);
@@ -228,19 +228,16 @@ protected:
 #ifdef DEBUG_LAYOUT
     virtual void GetBoxName(nsAutoString& aName);
     void PaintXULDebugBackground(nsIRenderingContext& aRenderingContext,
                                  nsPoint aPt);
     void PaintXULDebugOverlay(nsIRenderingContext& aRenderingContext,
                               nsPoint aPt);
 #endif
 
-    virtual PRBool GetWasCollapsed(nsBoxLayoutState& aState);
-    virtual void SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas);
-
     virtual PRBool GetInitialEqualSize(PRBool& aEqualSize); 
     virtual void GetInitialOrientation(PRBool& aIsHorizontal);
     virtual void GetInitialDirection(PRBool& aIsNormal);
     virtual PRBool GetInitialHAlignment(Halignment& aHalign); 
     virtual PRBool GetInitialVAlignment(Valignment& aValign); 
     virtual PRBool GetInitialAutoStretch(PRBool& aStretch); 
   
     virtual void Destroy();
--- a/layout/xul/base/src/nsLeafBoxFrame.cpp
+++ b/layout/xul/base/src/nsLeafBoxFrame.cpp
@@ -442,20 +442,8 @@ nsLeafBoxFrame::MarkIntrinsicWidthsDirty
   // IsBoxWrapped check.
 }
 
 NS_IMETHODIMP
 nsLeafBoxFrame::DoLayout(nsBoxLayoutState& aState)
 {
     return nsBox::DoLayout(aState);
 }
-
-PRBool
-nsLeafBoxFrame::GetWasCollapsed(nsBoxLayoutState& aState)
-{
-    return nsBox::GetWasCollapsed(aState);
-}
-
-void
-nsLeafBoxFrame::SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas)
-{
-    nsBox::SetWasCollapsed(aState, aWas);
-}
--- a/layout/xul/base/src/nsLeafBoxFrame.h
+++ b/layout/xul/base/src/nsLeafBoxFrame.h
@@ -105,19 +105,16 @@ public:
                               nsIAtom* aAttribute,
                               PRInt32 aModType);
 
   virtual PRBool GetMouseThrough() const;
   virtual PRBool ComputesOwnOverflowArea() { return PR_FALSE; }
 
 protected:
 
-  virtual PRBool GetWasCollapsed(nsBoxLayoutState& aState);
-  virtual void SetWasCollapsed(nsBoxLayoutState& aState, PRBool aWas);
-
   NS_IMETHOD DoLayout(nsBoxLayoutState& aState);
 
 #ifdef DEBUG_LAYOUT
   virtual void GetBoxName(nsAutoString& aName);
 #endif
 
   virtual nscoord GetIntrinsicWidth();