Bug 1334403 - Make <caption> inline size stretch again for table flex items. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Sun, 29 Jan 2017 04:02:59 +0100
changeset 331587 ca810c416600d929c2775c4661686fc331b571b6
parent 331586 f5d5bdc8802c6d68cdfaeddcbd2d862a98cbeccb
child 331588 410a33e2a95e0b405f42323c27ba32a98e2161b4
push id31275
push userphilringnalda@gmail.com
push dateSun, 29 Jan 2017 17:02:37 +0000
treeherdermozilla-central@77af15f468e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1334403
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1334403 - Make <caption> inline size stretch again for table flex items. r=dholbert
layout/generic/ReflowInput.cpp
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2384,18 +2384,22 @@ 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();
+        // XXX grid-specific for now; maybe remove this check after we address bug 799725
+        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 &&