Remove/simplify frame list use. b=510137 r=bernd
authorMats Palmgren <matspal@gmail.com>
Fri, 04 Sep 2009 23:07:43 +0200
changeset 32249 523039040a4b6330e7c586432e4797c1011f0f97
parent 32248 2280c99565bbce739db227f437136e2840cf7cde
child 32250 d32b4b3c29ac8bd8b6b12f7a460b855164720a33
push id8943
push usermpalmgren@mozilla.com
push dateFri, 04 Sep 2009 21:08:06 +0000
treeherdermozilla-central@523039040a4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbernd
bugs510137
milestone1.9.3a1pre
Remove/simplify frame list use. b=510137 r=bernd
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowFrame.h
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -1304,55 +1304,40 @@ nsTableRowFrame::CollapseRowIfNecessary(
   FinishAndStoreOverflow(&overflowArea, nsSize(rowRect.width,
                                               rowRect.height));
 
   nsTableFrame::RePositionViews(this);
   nsTableFrame::InvalidateFrame(this, oldRect, oldOverflowRect, PR_FALSE);
   return shift;
 }
 
-
-/**
- * These 3 functions are called by the row group frame's SplitRowGroup() code when
- * it creates a continuing cell frame and wants to insert it into the row's child list
+/*
+ * The following method is called by the row group frame's SplitRowGroup()
+ * when it creates a continuing cell frame and wants to insert it into the
+ * row's child list.
  */
 void 
 nsTableRowFrame::InsertCellFrame(nsTableCellFrame* aFrame,
-                                 nsTableCellFrame* aPrevSibling)
-{
-  mFrames.InsertFrame(nsnull, aPrevSibling, aFrame);
-  aFrame->SetParent(this);
-}
-
-void 
-nsTableRowFrame::InsertCellFrame(nsTableCellFrame* aFrame,
                                  PRInt32           aColIndex)
 {
   // Find the cell frame where col index < aColIndex
   nsTableCellFrame* priorCell = nsnull;
   for (nsIFrame* child = mFrames.FirstChild(); child;
        child = child->GetNextSibling()) {
     nsTableCellFrame *cellFrame = do_QueryFrame(child);
     if (cellFrame) {
       PRInt32 colIndex;
       cellFrame->GetColIndex(colIndex);
       if (colIndex < aColIndex) {
         priorCell = cellFrame;
       }
       else break;
     }
   }
-  InsertCellFrame(aFrame, priorCell);
-}
-
-void 
-nsTableRowFrame::RemoveCellFrame(nsTableCellFrame* aFrame)
-{
-  if (!mFrames.RemoveFrame(aFrame))
-    NS_ASSERTION(PR_FALSE, "frame not in list");
+  mFrames.InsertFrame(this, priorCell, aFrame);
 }
 
 nsIAtom*
 nsTableRowFrame::GetType() const
 {
   return nsGkAtoms::tableRowFrame;
 }
 
--- a/layout/tables/nsTableRowFrame.h
+++ b/layout/tables/nsTableRowFrame.h
@@ -183,24 +183,26 @@ public:
     *                         to be collapsed
     * @param aDidCollapse   - the row has been collapsed
     */
   nscoord CollapseRowIfNecessary(nscoord aRowOffset,
                                  nscoord aWidth,
                                  PRBool  aCollapseGroup,
                                  PRBool& aDidCollapse);
 
-  void InsertCellFrame(nsTableCellFrame* aFrame, 
-                       nsTableCellFrame* aPrevSibling);
-
+  /**
+   * Insert a cell frame after the last cell frame that has a col index
+   * that is less than aColIndex.  If no such cell frame is found the
+   * frame to insert is prepended to the child list.
+   * @param aFrame the cell frame to insert
+   * @param aColIndex the col index
+   */
   void InsertCellFrame(nsTableCellFrame* aFrame,
                        PRInt32           aColIndex);
 
-  void RemoveCellFrame(nsTableCellFrame* aFrame);
-
   nsresult CalculateCellActualSize(nsIFrame*       aRowFrame,
                                    nscoord&        aDesiredWidth,
                                    nscoord&        aDesiredHeight,
                                    nscoord         aAvailWidth);
 
   PRBool IsFirstInserted() const;
   void   SetFirstInserted(PRBool aValue);