Commit 1691bb10 authored by cbiesinger's avatar cbiesinger Committed by Commit bot

[css-flexbox] Pass correct available width to constrainLogicalWidthByMinMax

When stretching we used to pass the wrong available width to
constrainLogicalWidthByMinMax, leading to an incorrect calculation of
percentage max/min widths.

BUG=675333
R=mstensho@opera.com,eae@chromium.org

Review-Url: https://codereview.chromium.org/2585423002
Cr-Commit-Position: refs/heads/master@{#439772}
parent 1b02fcf4
<!DOCTYPE html>
<link rel="stylesheet" href="resources/flexbox.css">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox')">
<p>Both bars should be the same width</p>
<div class="flexbox column" style="width: 400px;">
<div data-expected-width="200" style="margin-left: 50%; width: 50%; background: green;">
Content
</div>
</div>
<div class="flexbox column" style="width: 400px;">
<div data-expected-width="200" style="margin-left: 50%; max-width: 50%; background: blue;">
Content
</div>
</div>
...@@ -2132,8 +2132,8 @@ void LayoutFlexibleBox::applyStretchAlignmentToChild( ...@@ -2132,8 +2132,8 @@ void LayoutFlexibleBox::applyStretchAlignmentToChild(
LayoutUnit childWidth = LayoutUnit childWidth =
(lineCrossAxisExtent - crossAxisMarginExtentForChild(child)) (lineCrossAxisExtent - crossAxisMarginExtentForChild(child))
.clampNegativeToZero(); .clampNegativeToZero();
childWidth = childWidth = child.constrainLogicalWidthByMinMax(
child.constrainLogicalWidthByMinMax(childWidth, childWidth, this); childWidth, crossAxisContentExtent(), this);
if (childWidth != child.logicalWidth()) { if (childWidth != child.logicalWidth()) {
child.setOverrideLogicalContentWidth( child.setOverrideLogicalContentWidth(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment