Commit 8a70f8ae authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Fix setting of fixed_block_is_definite

When a flex item has a definite specified height (e.g. height: 100px),
then percentages in children of the flex item should resolve even
if the flexbox does not have an explicit height, ie. does not match
the condition in https://drafts.csswg.org/css-flexbox/#definite-sizes

Bug: 885185

Change-Id: Iba226f30e1e02e3a11273fa45fcdf1cef897120c
Reviewed-on: https://chromium-review.googlesource.com/c/1311534
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604483}
parent 5b7aa951
......@@ -1811,6 +1811,7 @@ crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/per
crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-heights-002.html [ Skip ]
crbug.com/467127 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-heights-003.html [ Skip ]
crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-heights-004.html [ Skip ]
crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-heights-005.html [ Skip ]
crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-heights-quirks-node.html [ Skip ]
crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-size-subitems-001.html [ Skip ]
crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-flexbox/percentage-widths-001.html [ Skip ]
......
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tests that we consider main axis sizes to be definite in column flexboxes
when the height is an explicit definite height, even if the container does
not have a definite main axis size.</title>
<link rel="author" title="Google Inc." href="https://www.google.com/">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#definite-sizes">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="display:flex; flex-direction:column;">
<div style="width:100px; height:100px; background:red;">
<div style="height:100%; background:green;"></div>
</div>
</div>
......@@ -170,9 +170,12 @@ NGConstraintSpace NGConstraintSpace::CreateFromLayoutObject(
fixed_block = true;
}
if (box.IsFlexItem() && fixed_block) {
// The flexbox-specific behavior is in addition to regular definite-ness, so
// if the flex item would normally have a definite height it should keep it.
fixed_block_is_definite =
ToLayoutFlexibleBox(box.Parent())
->UseOverrideLogicalHeightForPerentageResolution(box);
->UseOverrideLogicalHeightForPerentageResolution(box) ||
(box.IsLayoutBlock() && ToLayoutBlock(box).HasDefiniteLogicalHeight());
}
bool is_new_fc = true;
......
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