Commit 8495f49a authored by David Grogan's avatar David Grogan Committed by Commit Bot

[Layout] SetNeedsLayout when an flex-item image loads

Flex layout incorporates an image's intrinsic size even when it has a
specified height and width.

Bug: 1042329
Change-Id: I206ba12a07103b4b90c364fb19b70b8ba2784d7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050821
Commit-Queue: David Grogan <dgrogan@chromium.org>
Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#741091}
parent 90802781
......@@ -156,6 +156,10 @@ bool LayoutImage::NeedsLayoutOnIntrinsicSizeChange() const {
kDontRegisterPercentageDescendant);
if (!image_size_is_constrained)
return true;
// Flex layout algorithm uses the intrinsic image width/height even if
// width/height are specified.
if (IsFlexItemIncludingNG())
return true;
// FIXME: We only need to recompute the containing block's preferred size if
// the containing block's size depends on the image's size (i.e., the
// container uses shrink-to-fit sizing). There's no easy way to detect that
......
......@@ -1549,7 +1549,6 @@ crbug.com/626703 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozi
crbug.com/626703 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-justify-content-wmvert-001.xhtml [ Failure ]
crbug.com/626703 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-safe-overflow-position-001.html [ Failure ]
crbug.com/807497 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/anonymous-flex-item-005.html [ Failure ]
crbug.com/898186 virtual/layout_ng_flex_box/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-intrinsic-ratio-003v.html [ Pass Failure ]
crbug.com/953534 [ Mac ] virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/ttwf-reftest-flex-wrap.html [ Failure ]
crbug.com/953534 [ Mac ] virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/ttwf-reftest-flex-wrap-reverse.html [ Failure ]
crbug.com/1003506 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/percentage-heights-007.html [ Failure ]
......@@ -5208,8 +5207,6 @@ crbug.com/874162 [ Mac ] fast/events/selection-autoscroll-borderbelt.html [ Skip
# Flaky
crbug.com/894077 virtual/android/fullscreen/video-fixed-background.html [ Pass Failure ]
crbug.com/898186 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-intrinsic-ratio-003v.html [ Pass Failure ]
# Sheriff 2018-09-10
crbug.com/881207 fast/js/regress/splice-to-remove.html [ Timeout Pass ]
......
<!DOCTYPE html>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#content-size-suggestion">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="Chrome had a bug https://crbug.com/1042329 where min-height:auto was not updated after an image load when the image has a specified height and width.">
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: flex; flex-direction: column; height: 5px">
<img style="width: 100px; height: 100px;" src="support/200x200-green.png">
<script>
document.body.offsetTop;
// This test relies on the harness screenshotting after the image has loaded.
</script>
</div>
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