Commit 82ef3377 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

Revert "[css-flex] Update to newer spec about definite flex item sizes"

This reverts commit d572ce1d.

Reason for revert: Caused regression crbug.com/889435

Original change's description:
> [css-flex] Update to newer spec about definite flex item sizes
>
> Implements this change:
> https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8
>
> external/wpt/css/css-flexbox/percentage-heights-003.html ostensibly tests
> this, but I don't think the test is correct (and we don't pass it)
>
> TESTED=css3/flexbox/definite-main-size.html
>
> Bug: 784059
> Change-Id: I8ee0ee797b54a8166849ab6e9b9f019b9e43760b
> Reviewed-on: https://chromium-review.googlesource.com/1240871
> Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
> Commit-Queue: Emil A Eklund <eae@chromium.org>
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#593707}

TBR=cbiesinger@chromium.org,dgrogan@chromium.org,eae@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 784059,889435
Change-Id: Ia74fb5cf500aebcb876672497cce5295b0959b43
Reviewed-on: https://chromium-review.googlesource.com/1246291
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594399}
parent 9930f795
......@@ -61,10 +61,10 @@ rules and resolve the percentage:</p>
<div class="rect flex-none"></div>
</div>
<p>auto flex-basis. This is still definite.</p>
<p>auto flex-basis, we should ignore the percentage height here:</p>
<div class="flexbox column" style="height: 300px;">
<div data-expected-height="50">
<div style="height: 50%;" data-expected-height="25">
<div style="height: 50%;" data-expected-height="50">
<div class="rect"></div>
</div>
</div>
......
......@@ -1073,10 +1073,18 @@ bool LayoutFlexibleBox::MainSizeIsDefiniteForPercentageResolution(
const LayoutBox& child) const {
// This function implements section 9.8. Definite and Indefinite Sizes, case
// 2) of the flexbox spec.
// We need to check for the flexbox to have a definite main size.
// We make up a percentage to check whether we have a definite size.
if (!MainAxisLengthIsDefinite(child, Length(0, kPercent)))
// We need to check for the flexbox to have a definite main size, and for the
// flex item to have a definite flex basis.
const Length& flex_basis = FlexBasisForChild(child);
if (!MainAxisLengthIsDefinite(child, flex_basis))
return false;
if (!flex_basis.IsPercentOrCalc()) {
// If flex basis had a percentage, our size is guaranteed to be definite or
// the flex item's size could not be definite. Otherwise, we make up a
// percentage to check whether we have a definite size.
if (!MainAxisLengthIsDefinite(child, Length(0, kPercent)))
return false;
}
if (HasOrthogonalFlow(child))
return child.HasOverrideLogicalHeight();
......
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