gecko-dev/testing/web-platform/tests/css/css-flexbox/flexbox_align-items-stretch-4.html
David Grogan 4d5a865fd8 Bug 1589531 [wpt PR 19775] - [LayoutNG] Reland flex-item alignment, a=testonly
Automatic update from web-platform-tests
[LayoutNG] Reland flex-item alignment

We were stretching items that had auto cross margins. This patch sets a
flag on FlexItem when it needs relayout due to stretching. It's not
elegant but is also not intrusive.

This reverts commit 2390edbd75a34b6c6f42ee7586f8f86af3329781.

Bug: 845235, 1015475
Change-Id: Iebefb670f2d3ae4047565077776a6d7a1ff2c2fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867434
Commit-Queue: David Grogan <dgrogan@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708455}

--

wpt-commits: 854827cfcdf3142b122cac91774f40708bbcf1f7
wpt-pr: 19775
2019-10-31 12:16:26 +00:00

40 lines
1.1 KiB
HTML

<!DOCTYPE html>
<title>Auto cross margins and align-items: stretch</title>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#algo-stretch">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<meta name="flags" content="" />
<meta name="assert" content="Auto cross margins prevent an item from stretching." />
<link rel="bookmark" href="https://crbug.com/1015475" />
<style>
x-flexbox {
display: flex;
/* This makes auto margins prevent stretching without affecting position. Without
it the auto margins make the item move to the center of the window. */
width: 100px;
}
.item-with-auto-margin {
background: green;
margin: auto;
}
.pct-height-child {
height: 100%;
width: 100px;
background: red;
}
.second-child {
height: 100px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<x-flexbox>
<div class=item-with-auto-margin>
<div class="pct-height-child"></div>
<div class="second-child"></div>
</div>
</x-flexbox>