Commit 5fabb74a authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[FlexNG] Fix percentage-heights-010.html

This fixes the above testcase, marked as failing in:
https://chromium-review.googlesource.com/c/chromium/src/+/2015101

Essentially a flex-item, if it has any %-block-size children, needs to
mark itself as depending on %-block-size, as its definiteness can
change.

See note in ng_physical_container_fragment.cc as this is a *little* too
broad, as we should only check if the definiteness changes, not the
percentage block resolution size.

Bug: 845235
Change-Id: I78120f5dd65186ef9ad597f8a5717923cfa49144
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2016634
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarDavid Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734553}
parent cdf545cc
...@@ -212,16 +212,23 @@ bool NGPhysicalContainerFragment::DependsOnPercentageBlockSize( ...@@ -212,16 +212,23 @@ bool NGPhysicalContainerFragment::DependsOnPercentageBlockSize(
// element if it has a percentage block-size however, but this will return // element if it has a percentage block-size however, but this will return
// the correct result from below. // the correct result from below.
// There are two conditions where we need to know about an (arbitrary)
// descendant which depends on a %-block-size.
// - In quirks mode, the arbitrary descendant may depend the percentage
// resolution block-size given (to this node), and need to relayout if
// this size changes.
// - A flex-item may have its "definiteness" change, (e.g. if itself is a
// flex item which is being stretched). This definiteness change will
// affect any %-block-size children.
//
// NOTE(ikilpatrick): For the flex-item case this is potentially too general.
// We only need to know about if this flex-item has a %-block-size child if
// the "definiteness" changes, not if the percentage resolution size changes.
if ((builder.has_descendant_that_depends_on_percentage_block_size_ || if ((builder.has_descendant_that_depends_on_percentage_block_size_ ||
builder.is_legacy_layout_root_) && builder.is_legacy_layout_root_) &&
node.UseParentPercentageResolutionBlockSizeForChildren()) { (node.UseParentPercentageResolutionBlockSizeForChildren() ||
// Quirks mode has different %-block-size behaviour, than standards mode. node.IsFlexItem()))
// An arbitrary descendant may depend on the percentage resolution
// block-size given.
// If this is also an anonymous block we need to mark ourselves dependent
// if we have a dependent child.
return true; return true;
}
const ComputedStyle& style = builder.Style(); const ComputedStyle& style = builder.Style();
if (style.LogicalHeight().IsPercentOrCalc() || if (style.LogicalHeight().IsPercentOrCalc() ||
......
...@@ -1328,7 +1328,6 @@ crbug.com/845235 virtual/layout_ng_flex_box/css3/flexbox/relpos-with-percentage- ...@@ -1328,7 +1328,6 @@ crbug.com/845235 virtual/layout_ng_flex_box/css3/flexbox/relpos-with-percentage-
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/flex-aspect-ratio-img-column-004.html [ Failure ] crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/flex-aspect-ratio-img-column-004.html [ Failure ]
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/hittest-overlapping-margin.html [ Failure ] crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/hittest-overlapping-margin.html [ Failure ]
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/hittest-overlapping-order.html [ Failure ] crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/hittest-overlapping-order.html [ Failure ]
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/percentage-heights-010.html [ Failure ]
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/quirks-auto-block-size-with-percentage-item.html [ Pass Failure ] crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/quirks-auto-block-size-with-percentage-item.html [ Pass Failure ]
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-intrinsic-ratio-003.html [ Failure ] crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-intrinsic-ratio-003.html [ Failure ]
crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-intrinsic-ratio-004.html [ Failure ] crbug.com/845235 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-intrinsic-ratio-004.html [ Failure ]
......
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