Index: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
index 1eb668c54749a8922e573f36f951bdbcb2dc65f2..39536a4c68e23979924d3ce34a3959ea408cb752 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
@@ -985,7 +985,10 @@ bool LayoutFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedF |
double extraSpace = 0; |
bool childShrunk = false; |
if (availableFreeSpace > 0 && totalFlexGrow > 0 && flexSign == PositiveFlexibility && std::isfinite(totalFlexGrow)) { |
- extraSpace = availableFreeSpace * child->style()->flexGrow() / totalFlexGrow; |
+ if (totalFlexGrow < 1) |
+ extraSpace = availableFreeSpace * child->style()->flexGrow(); |
+ else |
+ extraSpace = availableFreeSpace * child->style()->flexGrow() / totalFlexGrow; |
} else if (availableFreeSpace < 0 && totalWeightedFlexShrink > 0 && flexSign == NegativeFlexibility && std::isfinite(totalWeightedFlexShrink) && child->style()->flexShrink()) { |
extraSpace = availableFreeSpace * child->style()->flexShrink() * childInnerFlexBaseSize / totalWeightedFlexShrink; |
childShrunk = true; |