Bug 1178250 - Don't call ConsiderChildOverflow until the child has been placed in the right location when reflowing a vertical-rl table. r=dholbert
authorJonathan Kew <jkew@mozilla.com>
Tue, 30 Jun 2015 10:14:19 +0100
changeset 250679 3524973b9630077c314cd6722af7199e5dd48e02
parent 250678 24c053ff08e95b66310d11ecf0e7bd7955d84694
child 250680 8551c158f429f871ed9d8dbab0198b192e245f6d
push idunknown
push userunknown
push dateunknown
reviewersdholbert
bugs1178250
milestone42.0a1
Bug 1178250 - Don't call ConsiderChildOverflow until the child has been placed in the right location when reflowing a vertical-rl table. r=dholbert
layout/tables/nsTableFrame.cpp
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -1911,22 +1911,16 @@ nsTableFrame::Reflow(nsPresContext*     
           borderPadding.BEnd(wm) + GetRowSpacing(GetRowCount()) +
           lastChildReflowed->GetNormalRect().YMost(); // XXX YMost should be B-flavored
       }
       haveDesiredBSize = true;
 
       mutable_rs.mFlags.mSpecialBSizeReflow = false;
     }
   }
-  else {
-    // Calculate the overflow area contribution from our children.
-    for (nsIFrame* kid : mFrames) {
-      ConsiderChildOverflow(aDesiredSize.mOverflowAreas, kid);
-    }
-  }
 
   aDesiredSize.ISize(wm) = aReflowState.ComputedISize() +
     aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm);
   if (!haveDesiredBSize) {
     CalcDesiredBSize(aReflowState, aDesiredSize);
   }
   if (IsRowInserted()) {
     ProcessRowInserted(aDesiredSize.BSize(wm));
@@ -1936,16 +1930,24 @@ nsTableFrame::Reflow(nsPresContext*     
     // If we didn't already know the containerWidth (and so used zero during
     // ReflowChildren), then we need to update the block-position of our kids.
     for (nsIFrame* kid : mFrames) {
       kid->MovePositionBy(nsPoint(aDesiredSize.Width(), 0));
       RePositionViews(kid);
     }
   }
 
+  // Calculate the overflow area contribution from our children. We couldn't
+  // do this on the fly during ReflowChildren(), because in vertical-rl mode
+  // with unconstrained width, we weren't placing them in their final positions
+  // until the fixupKidPositions loop just above.
+  for (nsIFrame* kid : mFrames) {
+    ConsiderChildOverflow(aDesiredSize.mOverflowAreas, kid);
+  }
+
   LogicalMargin borderPadding = GetChildAreaOffset(wm, &aReflowState);
   SetColumnDimensions(aDesiredSize.BSize(wm), wm, borderPadding,
                       aDesiredSize.Width());
   if (NeedToCollapse() &&
       (NS_UNCONSTRAINEDSIZE != aReflowState.AvailableISize())) {
     AdjustForCollapsingRowsCols(aDesiredSize, wm, borderPadding);
   }
 
@@ -3254,17 +3256,16 @@ nsTableFrame::ReflowChildren(nsTableRefl
       }
       aReflowState.bCoord += kidRect.BSize(wm);
 
       // If our bsize is constrained then update the available bsize.
       if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.BSize(wm)) {
         aReflowState.availSize.BSize(wm) -= cellSpacingB + kidRect.BSize(wm);
       }
     }
-    ConsiderChildOverflow(aOverflowAreas, kidFrame);
   }
 
   // We've now propagated the column resizes and geometry changes to all
   // the children.
   mBits.mResizedColumns = false;
   ClearGeometryDirty();
 }