Update web-platform-tests to revision cf8a15a334c6eb3b044b3db8a933436c2365819d

This commit is contained in:
WPT Sync Bot 2020-03-28 08:19:23 +00:00
parent 7d66871a9f
commit f4e67a0197
76 changed files with 1744 additions and 114 deletions

View file

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Flexbox: Change to auto-margin items in column flexbox</title>
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#valdef-flex-direction-column">
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-align-self">
<link rel="match" href="reference/columns-center-with-margins-001-ref.html">
<meta name="assert" content="This test ensures that auto margins for column flows are correctly calculated"/>
<link href="support/flexbox.css" rel="stylesheet">
<style>
.flexbox {
border: 1px solid black;
width: 400px;
height: 200px;
}
.item1 {
margin: 0 auto;
background: lightblue;
}
.item1v {
margin: auto 0;
background: lightblue;
}
.item2 {
background: lime;
}
</style>
</head>
<body>
<p>The test passes if the flex items are properly centered in each column</p>
<div class="flexbox column">
<div class="item1">centeredWithMargins</div>
<div class="item2 align-self-center">centeredWithAlignSelf</div>
</div>
<div style="writing-mode: vertical-lr;">
<div class="flexbox column">
<div class="item1v">centeredWithMargins</div>
<div class="item2 align-self-center">centeredWithAlignSelf</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,56 @@
<!DOCTYPE html>
<title>CSS Flexbox: 'contain' property strict value</title>
<link rel="help" href="https://drafts.csswg.org/css-contain/#contain-property">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#align-items-property">
<meta name="assert" content="This test ensures that the strict value of the 'contain'
property in combination with mixing of 'display' inline-flex value, 'align-items' flex-start
value, column direction works properly.">
<style>
.inline-flex {
display: inline-flex;
outline: solid;
background: red;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.inline-flex')">
<p>Stretched:</p>
<div class="inline-flex" style="display: inline-flex; flex-direction: column;" data-expected-width="0" data-expected-height="0">
<div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div>
</div>
<div class="inline-flex" data-expected-width="0" data-expected-height="0">
<div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div>
</div>
<div class="inline-flex" style="display: inline-flex; flex-direction: column;" data-expected-width="30" data-expected-height="30">
<div style="contain: strict; width: 30px; height: 30px;" data-expected-width="30" data-expected-height="30">Column</div>
</div>
<div class="inline-flex" style="display: inline-flex;" data-expected-width="30" data-expected-height="30">
<div style="contain: strict; width: 30px; height: 30px;" data-expected-width="30" data-expected-height="30">Row</div>
</div>
<p>Flex-start:</p>
<div class="inline-flex" style="flex-direction: column; align-items: flex-start;" data-expected-width="0" data-expected-height="0">
<div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div>
</div>
<div class="inline-flex" style="align-items: flex-start;" data-expected-width="0" data-expected-height="0">
<div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div>
</div>
<div class="inline-flex" style="flex-direction: column; align-items: flex-start;" data-expected-width="30" data-expected-height="30">
<div style="contain: strict; width: 30px; height: 30px;" data-expected-width="30" data-expected-height="30">Column</div>
</div>
<div class="inline-flex" style="align-items: flex-start;" data-expected-width="30" data-expected-height="30">
<div style="contain: strict; width: 30px; height: 30px;" data-expected-width="30" data-expected-height="30">Row</div>
</div>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Flex transferred minimum height</title>
<link rel="author" title="dgrogan@chromium.org" href="mailto:dgrogan@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#transferred-size-suggestion" />
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html" />
<meta name="assert" content="min-height: auto honors transferred size suggestion">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height: 50px; background: green;"></div>
<div style="display: flex; flex-direction: column; height: 0px">
<img src="support/300x150-green.png" style="width: 100px">
</div>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Flex transferred minimum height</title>
<link rel="author" title="dgrogan@chromium.org" href="mailto:dgrogan@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#transferred-size-suggestion" />
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html" />
<meta name="assert" content="min-height: auto honors transferred size suggestion subject to cross axis min/max sizes">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height: 50px; background: green;"></div>
<div style="display: flex; flex-direction: column; height: 0px">
<img src="support/300x150-green.png" style="width: 0px; min-width: 100px;">
</div>

View file

@ -0,0 +1,80 @@
<!DOCTYPE html>
<title>CSS Flexbox: flexbox with min-size: auto</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#min-size-auto">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-basis-property">
<link rel="bookmark" href="https://crbug.com/426898">
<link href="support/flexbox.css" rel="stylesheet">
<meta name="assert" content="Flexbox with min-size: auto is handled correctly.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<style>
.flexbox {
width: 10px;
height: 10px;
background-color: grey;
}
.item {
background-color: red;
margin: 5px;
}
.child {
height: 100px;
width: 100px;
background-color: green;
}
.width-20 {
width: 20px;
}
.flex-basis-20 {
flex-basis: 20px;
}
</style>
<body onload="checkLayout('.flexbox, .inline-flexbox');">
<div id=log></div>
<div class="flexbox" data-expected-width="10">
<div class="item" data-expected-width="100">
<div class="child" data-expected-width="100"></div>
</div>
</div>
<div class="flexbox column" data-expected-height="10">
<div class="item" data-expected-height="100">
<div class="child" data-expected-height="100"></div>
</div>
</div>
<div class="inline-flexbox column" data-expected-height="110">
<div class="item flex-basis-20" data-expected-height="100">
<div class="child" data-expected-height="100"></div>
</div>
</div>
<div class="flexbox" data-expected-width="10">
<div class="item width-20" data-expected-width="20">
<div class="child" data-expected-width="100"></div>
</div>
</div>
<div class="flexbox" data-expected-width="10">
<div class="item flex-basis-20" data-expected-width="100">
<div class="child" data-expected-width="100"></div>
</div>
</div>
<div class="inline-flexbox" data-expected-width="110">
<div class="item flex-basis-20" data-expected-width="100">
<div class="child" data-expected-width="100"></div>
</div>
</div>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Flex transferred minimum width</title>
<link rel="author" title="dgrogan@chromium.org" href="mailto:dgrogan@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#transferred-size-suggestion" />
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html" />
<meta name="assert" content="min-width: auto honors transferred size suggestion">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height: 50px; background: green;"></div>
<div style="display: flex; width: 0px"> <!-- width:0 makes items shrink to min-width -->
<img src="support/300x150-green.png" style="height: 50px">
</div>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Flex transferred minimum width</title>
<link rel="author" title="dgrogan@chromium.org" href="mailto:dgrogan@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#transferred-size-suggestion" />
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html" />
<meta name="assert" content="min-width: auto honors transferred size suggestion subject to cross axis min/max sizes">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height: 50px; background: green;"></div>
<div style="display: flex; width: 0px"> <!-- width:0 makes items shrink to min-width -->
<img src="support/300x150-green.png" style="height: 2000px; max-height: 50px">
</div>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<title>Flex transferred minimum width</title>
<link rel="author" title="dgrogan@chromium.org" href="mailto:dgrogan@chromium.org" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#min-size-auto" />
<link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
<meta name="assert" content="min-width: auto ignores transferred size suggestion when item has a definite main size">
<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="width:100px; height: 75px; background: green;"></div>
<div style="display: flex; width: 0px">
<!--
content size suggestion is 300px.
specified size suggestion is 100px.
transferred size suggestion is 50px, but that is ignored because there is a
specified size. The ignoring is from the spec text that says,
(capitalization added):
In general, the content-based minimum size of a flex item is the smaller of
its content size suggestion and its specified size suggestion. However, if
the box has an aspect ratio AND NO specified size, its content-based
minimum size is the smaller of its content size suggestion and its
transferred size suggestion.
So here the content-based minimum size is min(300, 100) = 100.
-->
<img src="support/300x150-green.png" style="height: 25px; width: 100px;">
</div>

View file

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<title>CSS Flexbox: height resizing with flex-direction: column</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property">
<link rel="help" href="https://crbug.com/527039">
<meta name="assert" content="This test checks that resizing the height of a layout with two nested flexboxes using 'flex-direction: column' correctly recalculates the outer box's height." />
<style>
body,
html {
height: 100%;
}
.OuterFlexbox {
display: flex;
flex-direction: column;
height: 100%;
}
.InnerFlexbox {
display: flex;
flex-direction: column;
max-height: 100%;
outline: 1px blue solid;
}
.InnerFlexbox-body {
flex: 1 1 auto;
overflow-y: hidden;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="update()">
<div class="OuterFlexbox" data-expected-height="250">
<div class="InnerFlexbox" data-expected-height="250">
<div class="InnerFlexbox-body" data-expected-height="250">
<ul>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
<li>Suspendisse eu nunc lectus. Curabitur.</li>
</ul>
</div>
</div>
</div>
<script>
function update() {
document.body.offsetHeight;
document.body.style.height = '50px';
document.body.offsetHeight;
document.body.style.height = '250px';
document.body.offsetHeight;
checkLayout('.OuterFlexbox');
}
</script>
</body>
</html>

View file

@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<title>CSS Flexbox: overflow:auto support.</title>
<link rel="help" href="https://www.w3.org/TR/css-overflow-3/#propdef-overflow">
<link rel="help" href="https://www.w3.org/TR/css-overflow-4/#classic-scrollbars">
<link rel="match" href="reference/flexbox-overflow-auto-001-ref.html">
<meta name="assert" content="This test ensures that flexbox with 'overflow: auto' is supported, including in combination with different writing-mode and flex-direction values."/>
<style>
.test-row {
display: flex;
margin-bottom: 5px;
}
.test-row > div {
flex: none;
}
.container {
margin-right: 5px;
border: 5px solid lightgreen;
width: 100px;
}
.horizontal-tb {
writing-mode: horizontal-tb;
}
.vertical-rl {
writing-mode: vertical-rl;
}
.vertical-lr {
writing-mode: vertical-lr;
}
.row {
flex-direction: row;
}
.row-reverse {
flex-direction: row-reverse;
}
.column {
flex-direction: column;
}
.column-reverse {
flex-direction: column-reverse;
}
.flexbox {
border: 0 solid pink;
display: flex;
height: 100px;
width: 100px;
overflow: auto;
}
.flexbox > div {
width: 200px;
height: 200px;
background: radial-gradient(at right 60%, red, yellow, green);
flex: none;
}
</style>
<body>
<p>Scrollbars should work in all the flexboxes.</p>
</body>
<script>
var writingModes = ['horizontal-tb', 'vertical-rl', 'vertical-lr'];
var flexDirections = ['row', 'column', 'row-reverse', 'column-reverse'];
var testContents = '';
writingModes.forEach(function(writingMode) {
testContents += "<div class='test-row'>";
flexDirections.forEach(function(flexDirection) {
var containerClass = 'container ' + writingMode;
var flexboxClass = 'flexbox ' + flexDirection;
testContents +=
"<div class='" + containerClass + "'>" +
"<div class='" + flexboxClass + "'>" +
"<div></div>" +
"</div>" +
"</div>";
});
testContents += "</div>";
});
document.body.innerHTML += testContents;
</script>
</body>
</html>

View file

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<title>CSS Flexbox: Height with overflow: auto.</title>
<link href="support/flexbox.css" rel="stylesheet">
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-direction-property">
<link rel="help" href="https://www.w3.org/TR/css-overflow-4/#classic-scrollbars">
<meta name="assert" content="This test ensures that flexbox with 'flex-direction: row|row-reverse' and a flex item child with 'overflow: auto' has the proper height."/>
<style>
.flexbox {
border: 5px solid green;
position: relative;
width: 50px;
}
.inline-flexbox {
border: 5px solid green;
position: relative;
height: 50px;
}
.overflow {
border: 1px solid red;
overflow: auto;
min-width: 0;
min-height: 0;
}
.vertical {
writing-mode: vertical-rl;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox, .inline-flexbox')">
<div id=log></div>
<div class="flexbox" data-expected-height="47">
<div class="overflow"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox row-reverse" data-expected-height="47">
<div class="overflow"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox vertical" data-expected-height="47">
<div class="overflow"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox row-reverse vertical" data-expected-height="47">
<div class="overflow"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox" data-expected-height="47">
<div class="overflow align-self-baseline"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox row-reverse" data-expected-height="47">
<div class="overflow align-self-baseline"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox vertical" data-expected-height="32">
<div class="overflow align-self-baseline"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="flexbox row-reverse vertical" data-expected-height="32">
<div class="overflow align-self-baseline"><div style="width: 100px; height: 20px"></div></div>
</div>
<div class="inline-flexbox column" data-expected-width="47">
<div class="overflow"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column-reverse" data-expected-width="47">
<div class="overflow"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column vertical" data-expected-width="47">
<div class="overflow"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column-reverse vertical" data-expected-width="47">
<div class="overflow"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column" data-expected-width="47">
<div class="overflow align-self-baseline"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column-reverse" data-expected-width="47">
<div class="overflow align-self-baseline"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column vertical" data-expected-width="32">
<div class="overflow align-self-baseline"><div style="width: 20px; height: 100px"></div></div>
</div>
<div class="inline-flexbox column-reverse vertical" data-expected-width="32">
<div class="overflow align-self-baseline"><div style="width: 20px; height: 100px"></div></div>
</div>
</body>
</html>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS Flexbox: justify-content: space-between on the last item of a column</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#justify-content-property">
<link rel="bookmark" href="https://crbug.com/690024">
<meta name="assert" content="This test checks when processing the last item on a column we should not add justify-content space to the row height.">
<style>
.flexbox {
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 500px;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox')">
<div class="flexbox" data-expected-height="500">
<div>First item</div>
<div>Second item</div>
</div>

View file

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<title>CSS Flexbox: correct width for non-overflowing content with flex-direction: column</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property">
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#overflow-properties">
<link rel="help" href="https://crbug.com/580586">
<meta name="assert" content="This test checks that no unnecessary extra horizontal space is considered for vertical scrollbars for non-overflowing content using flex-direction: column." />
<style>
body {
height: 200vh;
}
section {
height: 400px;
display: flex;
flex-direction: column;
}
.side-menu {
border: 1px solid black;
width: 200px;
display: flex;
flex-direction: column;
}
.box-body {
height: 1000px;
flex: 1 1 0%;
display: flex;
min-height: 0px;
}
.list {
list-style: none;
padding: 0;
overflow: auto;
flex: 1 1 0;
}
li {
height: 20px;
background-color: red;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('section')">
<div id=log></div>
<section>
<div class="box-body">
<div class="side-menu">
<ul class="list">
<li data-expected-width="200">
</li>
</ul>
</div>
<div style="height: 1000px;"></div>
</div>
</section>
</body>
</html>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<link href="../support/flexbox.css" rel="stylesheet">
<style>
.flexbox {
border: 1px solid black;
width: 400px;
height: 200px;
}
.item1 {
background: lightblue;
}
.item2 {
background: lime;
}
</style>
</head>
<body>
<p>The test passes if the flex items are properly centered in each column</p>
<div class="flexbox column">
<div class="item1 align-self-center">centeredWithMargins</div>
<div class="item2 align-self-center">centeredWithAlignSelf</div>
</div>
<div style="writing-mode: vertical-lr;">
<div class="flexbox column">
<div class="item1 align-self-center">centeredWithMargins</div>
<div class="item2 align-self-center">centeredWithAlignSelf</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<style>
.test-row {
display: flex;
margin-bottom: 5px;
}
.test-row > div {
flex: none;
}
.container {
margin-right: 5px;
border: 5px solid lightgreen;
width: 100px;
}
.flexbox {
display: block;
height: 100px;
width: 100px;
overflow: auto;
}
.flexbox > div {
width: 200px;
height: 200px;
background: radial-gradient(at right 60%, red, yellow, green);
}
</style>
</head>
<body>
<p>Scrollbars should work in all the flexboxes.</p>
</body>
<script>
var results = [
'left top', 'left top', 'right top', 'left bottom',
'right top', 'right top', 'right bottom', 'left top',
'left top', 'left top', 'left bottom', 'right top'];
var testContents = '';
for (var i = 0; i < results.length; ++i) {
if (!(i % 4))
testContents += "<div class='test-row'>";
var containerClass = 'container ' + results[i];
testContents +=
"<div class='" + containerClass + "'>" +
"<div class='flexbox'>" +
"<div></div>" +
"</div>" +
"</div>";
if (i % 4 == 3)
testContents += "</div>";
}
document.body.innerHTML += testContents;
Array.prototype.forEach.call(document.querySelectorAll(".right"), function(element) {
element.firstChild.scrollLeft = 1000;
});
Array.prototype.forEach.call(document.querySelectorAll(".bottom"), function(element) {
element.firstChild.scrollTop = 1000;
});
</script>
</body>
</html>