Bug 1144096 part 23 - [css-grid] A grid container fragment that is an overflow container can't be INCOMPLETE, only OVERFLOW_INCOMPLETE and it should always have zero BSize. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Fri, 11 Mar 2016 17:39:27 +0100
changeset 339576 5b9834eee771d07a39bb5a254e3ccb6e1698f3a0
parent 339575 04b6926cb2f31a68ff93c63da594729326e2d602
child 339577 fbed3943a9e59cacb69cd4b062da39de1808cae2
push id12762
push userbmo:rail@mozilla.com
push dateFri, 11 Mar 2016 19:47:45 +0000
reviewersdholbert
bugs1144096
milestone48.0a1
Bug 1144096 part 23 - [css-grid] A grid container fragment that is an overflow container can't be INCOMPLETE, only OVERFLOW_INCOMPLETE and it should always have zero BSize. r=dholbert
layout/generic/nsGridContainerFrame.cpp
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -5070,16 +5070,28 @@ nsGridContainerFrame::Reflow(nsPresConte
   }
 
   LogicalSize desiredSize(wm, computedISize + bp.IStartEnd(wm),
                               bSize         + bp.BStartEnd(wm));
   aDesiredSize.SetSize(wm, desiredSize);
   aDesiredSize.mOverflowAreas.UnionAllWith(nsRect(0, 0,
                                                   aDesiredSize.Width(),
                                                   aDesiredSize.Height()));
+
+  // Convert INCOMPLETE -> OVERFLOW_INCOMPLETE and zero bsize if we're an OC.
+  if (HasAnyStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER)) {
+    if (!NS_FRAME_IS_COMPLETE(aStatus)) {
+      NS_FRAME_SET_OVERFLOW_INCOMPLETE(aStatus);
+      aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
+    }
+    bSize = 0;
+    desiredSize.BSize(wm) = bSize + bp.BStartEnd(wm);
+    aDesiredSize.SetSize(wm, desiredSize);
+  }
+
   if (!prevInFlow) {
     auto sharedGridData = static_cast<SharedGridData*>(
       Properties().Get(SharedGridData::Prop()));
     if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
       if (!sharedGridData) {
         sharedGridData = new SharedGridData;
         Properties().Set(SharedGridData::Prop(), sharedGridData);
       }