gecko-dev/testing/web-platform/tests/css/css-flexbox/align-content-wrap-001.html
Christian Biesinger bdbd4c49ee Bug 1507345 [wpt PR 14062] - [css-flex] align-content should apply even when there's just a single line, a=testonly
Automatic update from web-platform-tests[css-flex] align-content should apply even when there's just a single line

In Jan 2015 the spec changed in
https://drafts.csswg.org/css-flexbox/#change-201409-align-content-wrapping

Change our code accordingly. This effectively reverts commit
crrev.com/290823003 and relands crrev.com/2191683003

align-content-wrap-004 is a test for bug 641789, which was a regression
from the previous attempt at landing this patch.

Bug: 599828
Change-Id: I8de127c19203854922eb23a626cee4de9a772f22
Reviewed-on: https://chromium-review.googlesource.com/c/1323906
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608449}

--

wpt-commits: 34ecd56f063821c113fd20bcb05b80aafd82d787
wpt-pr: 14062
2018-11-21 13:59:08 +00:00

77 lines
2.7 KiB
HTML

<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#propdef-align-content" />
<title>css-flexbox: Tests align-content with single-line flex-wrap: wrap</title>
<style>
.default {
display: flex;
flex-wrap: wrap;
position: relative;
height: 70px;
border: 1px solid red;
margin: 5px;
}
.default > div {
height: 20px;
}
.verticalWriting {
display: flex;
flex-wrap: wrap;
position: relative;
width: 70px;
border: 1px solid red;
margin: 5px;
writing-mode: vertical-lr;
}
.verticalWriting > div {
width: 20px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
</head>
<body onload="checkLayout('.default, .verticalWriting'); ">
<div id=log></div>
<p>Test that we honor align-content even in single-line flex containers</p>
<div class="default" style="align-content: flex-start">
<div data-offset-y="0">This text should be at the top of its container</div>
</div>
<div class="default" style="align-content: flex-end">
<div data-offset-y="50">This text should be at the bottom of its container</div>
</div>
<div class="default" style="align-content: center">
<div data-offset-y="25">This text should be centered in its container</div>
</div>
<div class="default" style="align-content: space-between">
<div data-offset-y="0">This text should be at the top of its container</div>
</div>
<div class="default" style="align-content: space-around">
<div data-offset-y="25">This text should be centered in its container</div>
</div>
<div class="default" style="align-content: space-evenly">
<div data-offset-y="25">This text should be centered in its container</div>
</div>
<div class="default" style="align-content: stretch">
<div data-offset-y="0">This text should be at the top of its container</div>
</div>
<div class="verticalWriting" style="align-content: flex-start">
<div data-offset-x="0">This text should be at the left of its container</div>
</div>
<div class="verticalWriting" style="align-content: flex-end">
<div data-offset-x="50">This text should be at the right of its container</div>
</div>
<div class="verticalWriting" style="align-content: center">
<div data-offset-x="25">This text should be centered in its container</div>
</div>
<div class="verticalWriting" style="align-content: space-between">
<div data-offset-x="0">This text should be at the left of its container</div>
</div>
<div class="verticalWriting" style="align-content: space-around">
<div data-offset-x="25">This text should be centered in its container</div>
</div>
<div class="verticalWriting" style="align-content: stretch">
<div data-offset-x="0">This text should be at the left of its container</div>
</div>