Bug 1341009 - Reset aStatus before calling nsContainerFrame::ReflowChild(). draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 14 Sep 2017 14:15:03 +0800
changeset 666704 e7caf759589cdbc3d6bfe0d9963ad66d7ae5b90a
parent 666703 346cbb78fcca4aec86f1536be38610ff72a560ef
child 666705 b303367abe280e4af9e232426fd2b3c4fa8a7f66
push id80486
push userbmo:tlin@mozilla.com
push dateTue, 19 Sep 2017 03:52:30 +0000
bugs1341009
milestone57.0a1
Bug 1341009 - Reset aStatus before calling nsContainerFrame::ReflowChild(). This ensures the Reflow() call in nsContainerFrame::ReflowChild() is using an empty reflow status. MozReview-Commit-ID: K2Ln2i4XkB5
layout/generic/nsColumnSetFrame.cpp
layout/tables/nsTableFrame.cpp
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -800,16 +800,17 @@ nsColumnSetFrame::ReflowChildren(ReflowO
       // columns would flow around it.
 
       // Reflow the frame
       LogicalPoint origin(wm,
                           childOrigin.I(wm) +
                           kidReflowInput.ComputedLogicalMargin().IStart(wm),
                           childOrigin.B(wm) +
                           kidReflowInput.ComputedLogicalMargin().BStart(wm));
+      aStatus.Reset();
       ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput,
                   wm, origin, containerSize, 0, aStatus);
 
       reflowNext = aStatus.NextInFlowNeedsReflow();
 
 #ifdef DEBUG_roc
       printf("*** Reflowed child #%d %p: status = %d, desiredSize=%d,%d CarriedOutBEndMargin=%d\n",
              columnCount, (void*)child, aStatus, kidDesiredSize.Width(), kidDesiredSize.Height(),
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -3383,16 +3383,17 @@ nsTableFrame::ReflowChildren(TableReflow
       }
       // record the presence of a next in flow, it might get destroyed so we
       // need to reorder the row group array
       bool reorder = false;
       if (kidFrame->GetNextInFlow())
         reorder = true;
 
       LogicalPoint kidPosition(wm, aReflowInput.iCoord, aReflowInput.bCoord);
+      aStatus.Reset();
       ReflowChild(kidFrame, presContext, desiredSize, kidReflowInput,
                   wm, kidPosition, containerSize, 0, aStatus);
       kidReflowInput.ApplyRelativePositioning(&kidPosition, containerSize);
 
       if (reorder) {
         // reorder row groups the reflow may have changed the nextinflows
         OrderRowGroups(rowGroups, &thead, &tfoot);
         childX = rowGroups.IndexOf(kidFrame);