bug 229247 remove no op quirk code r=bzbarsky
authorBernd <bmlk@gmx.de>
Sat, 06 Mar 2010 10:53:02 +0100
changeset 39018 a4b34d3053c5f1d9b0abd32c7748c53d70ce72f5
parent 39017 ccc04ad335a837f0450ad4f6cd5a3b4c0fe5e48e
child 39019 2a3a2af10feb74cedbd5f484e4b23b66f7bec2a9
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs229247
milestone1.9.3a3pre
bug 229247 remove no op quirk code r=bzbarsky
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowFrame.h
layout/tables/nsTableRowGroupFrame.cpp
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -548,17 +548,17 @@ nsTableRowFrame::CalcHeight(const nsHTML
 
   for (nsIFrame* kidFrame = mFrames.FirstChild(); kidFrame;
        kidFrame = kidFrame->GetNextSibling()) {
     nsTableCellFrame *cellFrame = do_QueryFrame(kidFrame);
     if (cellFrame) {
       nscoord availWidth = cellFrame->GetPriorAvailWidth();
       nsSize desSize = cellFrame->GetDesiredSize();
       if ((NS_UNCONSTRAINEDSIZE == aReflowState.availableHeight) && !GetPrevInFlow()) {
-        CalculateCellActualSize(kidFrame, desSize.width, desSize.height, availWidth);
+        CalculateCellActualHeight(cellFrame, desSize.height);
       }
       // height may have changed, adjust descent to absorb any excess difference
       nscoord ascent;
        if (!kidFrame->GetFirstChild(nsnull)->GetFirstChild(nsnull))
          ascent = desSize.height;
        else
          ascent = cellFrame->GetCellBaseline();
       nscoord descent = desSize.height - ascent;
@@ -637,36 +637,33 @@ nsTableRowFrame::GetSkipSides() const
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nsnull != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
 }
 
-// Calculate the cell's actual size given its pass2 desired width and height.
-// Takes into account the specified height (in the style), and any special logic
-// needed for backwards compatibility.
-// Modifies the desired width and height that are passed in.
+// Calculate the cell's actual height given its pass2  height.
+// Takes into account the specified height (in the style).
+// Modifies the desired height that is passed in.
 nsresult
-nsTableRowFrame::CalculateCellActualSize(nsIFrame* aCellFrame,
-                                         nscoord&  aDesiredWidth,
-                                         nscoord&  aDesiredHeight,
-                                         nscoord   aAvailWidth)
+nsTableRowFrame::CalculateCellActualHeight(nsTableCellFrame* aCellFrame,
+                                           nscoord&          aDesiredHeight)
 {
   nscoord specifiedHeight = 0;
   
   // Get the height specified in the style information
   const nsStylePosition* position = aCellFrame->GetStylePosition();
 
   nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
   if (!tableFrame)
     return NS_ERROR_NULL_POINTER;
   
-  PRInt32 rowSpan = tableFrame->GetEffectiveRowSpan((nsTableCellFrame&)*aCellFrame);
+  PRInt32 rowSpan = tableFrame->GetEffectiveRowSpan(*aCellFrame);
   
   switch (position->mHeight.GetUnit()) {
     case eStyleUnit_Coord:
       specifiedHeight = position->mHeight.GetCoordValue();
       if (1 == rowSpan) 
         SetFixedHeight(specifiedHeight);
       break;
     case eStyleUnit_Percent: {
@@ -678,20 +675,16 @@ nsTableRowFrame::CalculateCellActualSize
     case eStyleUnit_Auto:
     default:
       break;
   }
 
   // If the specified height is greater than the desired height, then use the specified height
   if (specifiedHeight > aDesiredHeight)
     aDesiredHeight = specifiedHeight;
- 
-  if ((0 == aDesiredWidth) && (NS_UNCONSTRAINEDSIZE != aAvailWidth)) { // special Nav4 compatibility code for the width
-    aDesiredWidth = aAvailWidth;
-  } 
 
   return NS_OK;
 }
 
 // Calculates the available width for the table cell based on the known
 // column widths taking into account column spans and column spacing
 static nscoord
 CalcAvailWidth(nsTableFrame&     aTableFrame,
@@ -943,21 +936,19 @@ nsTableRowFrame::ReflowChildren(nsPresCo
           // positioned properly. We have to do this, because any one of our parent
           // frames could have moved and we have no way of knowing...
           nsTableFrame::RePositionViews(kidFrame);
         }
       }
       
       if (NS_UNCONSTRAINEDSIZE == aReflowState.availableHeight) {
         if (!GetPrevInFlow()) {
-          // Calculate the cell's actual size given its pass2 size. This function
-          // takes into account the specified height (in the style), and any special
-          // logic needed for backwards compatibility
-          CalculateCellActualSize(kidFrame, desiredSize.width, 
-                                  desiredSize.height, availCellWidth);
+          // Calculate the cell's actual height given its pass2 height. This
+          // function takes into account the specified height (in the style)
+          CalculateCellActualHeight(cellFrame, desiredSize.height);
         }
         // height may have changed, adjust descent to absorb any excess difference
         nscoord ascent;
         if (!kidFrame->GetFirstChild(nsnull)->GetFirstChild(nsnull))
           ascent = desiredSize.height;
         else
           ascent = ((nsTableCellFrame *)kidFrame)->GetCellBaseline();
         nscoord descent = desiredSize.height - ascent;
--- a/layout/tables/nsTableRowFrame.h
+++ b/layout/tables/nsTableRowFrame.h
@@ -193,20 +193,18 @@ public:
    * 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);
 
-  nsresult CalculateCellActualSize(nsIFrame*       aRowFrame,
-                                   nscoord&        aDesiredWidth,
-                                   nscoord&        aDesiredHeight,
-                                   nscoord         aAvailWidth);
+  nsresult CalculateCellActualHeight(nsTableCellFrame* aCellFrame,
+                                     nscoord&          aDesiredHeight);
 
   PRBool IsFirstInserted() const;
   void   SetFirstInserted(PRBool aValue);
 
   PRBool GetContentHeight() const;
   void   SetContentHeight(nscoord aTwipValue);
 
   PRBool HasStyleHeight() const;
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -673,18 +673,17 @@ nsTableRowGroupFrame::CalculateRowHeight
               if (rowInfo[rowIndex + spanX].isSpecial) {
                 numSpecialRowsSpanned++;
               }
             } 
             nscoord heightOfAreaSpanned = heightOfRowsSpanned + cellSpacingTotal;
             // get the height of the cell 
             nsSize cellFrameSize = cellFrame->GetSize();
             nsSize cellDesSize = cellFrame->GetDesiredSize();
-            rowFrame->CalculateCellActualSize(cellFrame, cellDesSize.width, 
-                                              cellDesSize.height, cellDesSize.width);
+            rowFrame->CalculateCellActualHeight(cellFrame, cellDesSize.height);
             cellFrameSize.height = cellDesSize.height;
             if (cellFrame->HasVerticalAlignBaseline()) {
               // to ensure that a spanning cell with a long descender doesn't
               // collide with the next row, we need to take into account the shift
               // that will be done to align the cell on the baseline of the row.
               cellFrameSize.height += rowFrame->GetMaxCellAscent() -
                                       cellFrame->GetCellBaseline();
             }