imported patch 1334403
authorMats Palmgren <mats@mozilla.com>
Fri, 27 Jan 2017 21:24:46 +0100
changeset 946321 1d6efc4fb572b8dbc7e4adc9c39e106a22251e78
parent 945723 c66216e8502223084c7d0aef237f99177420be57
child 946322 127114d39cc00d1eeb6d26b8de717c9d1c319625
push id166736
push usermpalmgren@mozilla.com
push dateFri, 27 Jan 2017 20:26:48 +0000
treeherdertry@127114d39cc0 [default view] [failures only]
bugs1334403
milestone54.0a1
imported patch 1334403
layout/generic/ReflowInput.cpp
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2384,18 +2384,21 @@ ReflowInput::InitConstraints(nsPresConte
         computeSizeFlags =
           ComputeSizeFlags(computeSizeFlags | ComputeSizeFlags::eUseAutoBSize);
       }
 
       nsIFrame* alignCB = mFrame->GetParent();
       nsIAtom* alignCBType = alignCB ? alignCB->GetType() : nullptr;
       if (alignCBType == nsGkAtoms::tableWrapperFrame &&
           alignCB->GetParent()) {
-        alignCB = alignCB->GetParent();
-        alignCBType = alignCB->GetType();
+        auto parentCBType = alignCB->GetParent()->GetType();
+        if (parentCBType == nsGkAtoms::gridContainerFrame) {
+          alignCB = alignCB->GetParent();
+          alignCBType = parentCBType;
+        }
       }
       if (alignCBType == nsGkAtoms::gridContainerFrame) {
         // Shrink-wrap grid items that will be aligned (rather than stretched)
         // in its inline axis.
         auto inlineAxisAlignment = wm.IsOrthogonalTo(cbwm) ?
           mStylePosition->UsedAlignSelf(mFrame->StyleContext()->GetParent()) :
           mStylePosition->UsedJustifySelf(mFrame->StyleContext()->GetParent());
         if ((inlineAxisAlignment != NS_STYLE_ALIGN_STRETCH &&