Commit d572ce1d authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[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: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593707}
parent 723be3e4
......@@ -61,10 +61,10 @@ rules and resolve the percentage:</p>
<div class="rect flex-none"></div>
</div>
<p>auto flex-basis, we should ignore the percentage height here:</p>
<p>auto flex-basis. This is still definite.</p>
<div class="flexbox column" style="height: 300px;">
<div data-expected-height="50">
<div style="height: 50%;" data-expected-height="50">
<div style="height: 50%;" data-expected-height="25">
<div class="rect"></div>
</div>
</div>
......
......@@ -1073,18 +1073,10 @@ 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, and for the
// flex item to have a definite flex basis.
const Length& flex_basis = FlexBasisForChild(child);
if (!MainAxisLengthIsDefinite(child, flex_basis))
// 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)))
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