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

[AspectRatio] Fix flex-aspect-ratio-024.tentative.html

ComputeBlockSizeForFragment does not take a fixed block size into account,
so ComputeInlineSizeFromAspectRatio needs to check for it separately.

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

Bug: 1045668
Change-Id: I7c3548881f8139681de7c8f1dcaf47cf2924a519
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441067
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Auto-Submit: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812635}
parent 55593427
...@@ -406,13 +406,18 @@ LayoutUnit ComputeInlineSizeFromAspectRatio(const NGConstraintSpace& space, ...@@ -406,13 +406,18 @@ LayoutUnit ComputeInlineSizeFromAspectRatio(const NGConstraintSpace& space,
if (LIKELY(style.AspectRatio().IsAuto())) if (LIKELY(style.AspectRatio().IsAuto()))
return kIndefiniteSize; return kIndefiniteSize;
if (!style.LogicalHeight().IsAuto() && block_size == kIndefiniteSize) { if (block_size == kIndefiniteSize) {
DCHECK(!style.HasOutOfFlowPosition()) << "OOF should pass in a block size"; if (space.IsFixedBlockSize()) {
block_size = ComputeBlockSizeForFragment(space, style, border_padding, block_size = space.AvailableSize().block_size;
kIndefiniteSize, base::nullopt); } else if (!style.LogicalHeight().IsAuto()) {
DCHECK(!style.HasOutOfFlowPosition())
<< "OOF should pass in a block size";
block_size = ComputeBlockSizeForFragment(space, style, border_padding,
kIndefiniteSize, base::nullopt);
}
if (block_size == kIndefiniteSize)
return kIndefiniteSize;
} }
if (block_size == kIndefiniteSize)
return kIndefiniteSize;
// Check if we can get an inline size using the aspect ratio. // Check if we can get an inline size using the aspect ratio.
return InlineSizeFromAspectRatio(border_padding, style.LogicalAspectRatio(), return InlineSizeFromAspectRatio(border_padding, style.LogicalAspectRatio(),
style.BoxSizing(), block_size); style.BoxSizing(), block_size);
......
...@@ -123,6 +123,7 @@ crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/abspos-013.tentative. ...@@ -123,6 +123,7 @@ crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/abspos-013.tentative.
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/block-aspect-ratio-024.tentative.html [ Failure ] crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/block-aspect-ratio-024.tentative.html [ Failure ]
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/block-aspect-ratio-028.tentative.html [ Failure ] crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/block-aspect-ratio-028.tentative.html [ Failure ]
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-009.tentative.html [ Failure ] crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-009.tentative.html [ Failure ]
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-014.tentative.html [ Failure ]
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/percentage-resolution-002.tentative.html [ Failure ] crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/percentage-resolution-002.tentative.html [ Failure ]
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/quirks-mode-001.tentative.html [ Failure ] crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/quirks-mode-001.tentative.html [ Failure ]
crbug.com/591099 external/wpt/css/css-sizing/clone-nowrap-intrinsic-size-bidi.html [ Failure ] crbug.com/591099 external/wpt/css/css-sizing/clone-nowrap-intrinsic-size-bidi.html [ Failure ]
......
...@@ -272,9 +272,6 @@ crbug.com/1007134 external/wpt/intersection-observer/v2/delay-test.html [ Pass F ...@@ -272,9 +272,6 @@ crbug.com/1007134 external/wpt/intersection-observer/v2/delay-test.html [ Pass F
crbug.com/1004547 external/wpt/intersection-observer/cross-origin-iframe.sub.html [ Pass Failure ] crbug.com/1004547 external/wpt/intersection-observer/cross-origin-iframe.sub.html [ Pass Failure ]
crbug.com/1007229 external/wpt/intersection-observer/same-origin-grand-child-iframe.sub.html [ Pass Failure ] crbug.com/1007229 external/wpt/intersection-observer/same-origin-grand-child-iframe.sub.html [ Pass Failure ]
# Not supported yet
crbug.com/1045668 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-014.tentative.html [ Failure ]
crbug.com/936084 external/wpt/css/css-sizing/max-content-input-001.html [ Failure ] crbug.com/936084 external/wpt/css/css-sizing/max-content-input-001.html [ Failure ]
crbug.com/849459 fragmentation/repeating-thead-under-repeating-thead.html [ Failure ] crbug.com/849459 fragmentation/repeating-thead-under-repeating-thead.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