Bug 1304636 - Part 2: Make GetComputedStyle report 'auto' for min-height:auto flex/grid items. r=dholbert, a=jcristau
authorBrad Werth <bwerth@mozilla.com>
Thu, 17 Nov 2016 15:41:49 -0800
changeset 352580 4d277820f6c286e65d2d47faddcbae65c845fcd5
parent 352579 1431cbeb85b0c7b7abfc861463db5535c9468bb2
child 352581 42550789be49ff103c01cc94f805eff9567efcfd
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, jcristau
bugs1304636
milestone52.0a2
Bug 1304636 - Part 2: Make GetComputedStyle report 'auto' for min-height:auto flex/grid items. r=dholbert, a=jcristau MozReview-Commit-ID: BmMvny3HePe
layout/style/nsComputedDOMStyle.cpp
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -4914,21 +4914,18 @@ nsComputedDOMStyle::ShouldHonorMinSizeAu
 }
 
 already_AddRefed<CSSValue>
 nsComputedDOMStyle::DoGetMinHeight()
 {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   nsStyleCoord minHeight = StylePosition()->mMinHeight;
 
-  if (eStyleUnit_Auto == minHeight.GetUnit()) {
-    // In non-flexbox contexts, "min-height: auto" means "min-height: 0"
-    // XXXdholbert For flex items, we should set |minHeight| to the
-    // -moz-min-content keyword, instead of 0, once we support -moz-min-content
-    // as a height value.
+  if (eStyleUnit_Auto == minHeight.GetUnit() &&
+      !ShouldHonorMinSizeAutoInAxis(eAxisVertical)) {
     minHeight.SetCoordValue(0);
   }
 
   SetValueToCoord(val, minHeight, true, nullptr, nsCSSProps::kWidthKTable);
   return val.forget();
 }
 
 already_AddRefed<CSSValue>