Commit ced49c96 authored by Christian Biesinger's avatar Christian Biesinger Committed by Chromium LUCI CQ

[AspectRatio] Correctly handle abspos replaced elements with aspect-ratio

R=ikilpatrick@chromium.org, mstensho@chromium.org

Bug: 1152698
Change-Id: I55879a551671b5b9a87ad83c59cc10a055b4cf5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2585814
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836299}
parent 8bf9fbd7
...@@ -752,7 +752,8 @@ scoped_refptr<const NGLayoutResult> NGOutOfFlowLayoutPart::Layout( ...@@ -752,7 +752,8 @@ scoped_refptr<const NGLayoutResult> NGOutOfFlowLayoutPart::Layout(
// We also include items with aspect ratio here, because if the inline size // We also include items with aspect ratio here, because if the inline size
// is auto and we have a definite block size, we want to use that for the // is auto and we have a definite block size, we want to use that for the
// inline size calculation. // inline size calculation.
bool compute_inline_from_ar = IsInlineSizeComputableFromBlockSize(node); bool compute_inline_from_ar =
IsInlineSizeComputableFromBlockSize(node) && !is_replaced;
if (AbsoluteNeedsChildInlineSize(node) || NeedMinMaxSize(candidate_style) || if (AbsoluteNeedsChildInlineSize(node) || NeedMinMaxSize(candidate_style) ||
should_be_considered_as_replaced || compute_inline_from_ar) { should_be_considered_as_replaced || compute_inline_from_ar) {
MinMaxSizesInput input(kIndefiniteSize, MinMaxSizesType::kContent); MinMaxSizesInput input(kIndefiniteSize, MinMaxSizesType::kContent);
......
<!DOCTYPE html>
<title>CSS aspect-ratio: out-of-flow replaced element</title>
<link rel="author" title="Google LLC" href="https://www.google.com/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<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="position: relative;">
<img src="support/200x200-green.png" style="position: absolute; aspect-ratio: auto 10/1; height: 100px;">
</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