Skip to content

Commit

Permalink
Bug 1630051 [wpt PR 22946] - [css-grid] Migrate flex-and-intrinsic-si…
Browse files Browse the repository at this point in the history
…zes.html to WPT, a=testonly

Automatic update from web-platform-tests
[css-grid] Migrate flex-and-intrinsic-sizes.html to WPT

CL also adds external/wpt/css/support/height-keyword-classes.css,
sibling to the existing width-keyword-classes.css File.
Note that WPT's height-keyword-classes.css is not a copy of its base
file fast/css-intrinsic-dimensions/resources/height-keyword-classes.css.
It simplifies some CSS classes declarations in the case the standard
form is supported by the major vendors.

Addition, the original flex-and-intrinsic-sizes.html is also kept,
in a simpler form, only with the non-standard behavior.

BUG=767015, 1063749
[email protected]

Change-Id: I751dcbde25a8c1ff3c1403be8d4a8eff21a65036
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2143836
Reviewed-by: Manuel Rego <[email protected]>
Commit-Queue: Antonio Gomes <[email protected]>
Cr-Commit-Position: refs/heads/master@{#759328}

--

wpt-commits: 8d4aa0541d69371d2672acd4afbc26a9479534c9
wpt-pr: 22946
  • Loading branch information
tonikitoo authored and moz-wptsync-bot committed Apr 21, 2020
1 parent 77e0d2a commit 4808191
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!DOCTYPE html>
<title>CSS Grid: track sizing algo with size restrictions and intrinsic sizes.</title>
<link rel="author" title="Sergio Villar" href="mailto:[email protected]"/>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#layout-algorithm"/>
<meta name="assert" content="This test ensures that fr tracks are properly sized whenever grid has intrinsic sizes."/>
<link rel="issue" href="https://crbug.com/423743"/>
<link href="/css/support/width-keyword-classes.css" rel="stylesheet"/>
<link href="/css/support/height-keyword-classes.css" rel="stylesheet"/>
<link href="/css/support/grid.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />

<style>
.container {
width: 100px;
height: 100px;
}

.grid {
grid-template-columns: 1fr;
grid-template-rows: 1fr;
}

div { font: 10px/1 Ahem; }
</style>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div class="container">
<div class="grid" data-expected-width="100" data-expected-height="10">
<div>XXX XXX</div>
</div>
</div>

<div class="container">
<div class="grid min-content" data-expected-width="30" data-expected-height="20">
<div>XXX XXX</div>
</div>
</div>

<div class="container">
<div class="grid max-content" data-expected-width="70" data-expected-height="10">
<div>XXX XXX</div>
</div>
</div>

<div class="container">
<div class="grid fit-content" data-expected-width="70" data-expected-height="10">
<div>XXX XXX</div>
</div>
</div>

<div class="min-content">
<div class="grid" data-expected-width="40" data-expected-height="50">
<div>XXX XXXX XX X XX XXX</div>
</div>
</div>

<div class="grid container" data-expected-width="100" data-expected-height="100">
<div style="display: grid; grid-template-columns: 3fr; grid-template-rows: 2fr;" data-expected-width="100" data-expected-height="100">
<div>XXX XXXX XX X XX XXX</div>
</div>
</div>

<div class="grid" style="grid; grid: 1fr 2fr / 2fr 1fr; width: 300px; height: 300px;" data-expected-width="300" data-expected-height="300">
<div class="firstRowFirstColumn" style="display: grid; grid: 1fr 3fr / 3fr 1fr;" data-expected-width="200" data-expected-height="100">
<div style="border: 2px solid magenta;" data-expected-width="150" data-expected-height="25">XXXX</div>
<div class="secondRowSecondColumn" style="border: 2px solid cyan;" data-expected-width="50" data-expected-height="75">XXXX XX XX</div>
</div>
<div class="secondRowSecondColumn" style="display: grid; grid: 3fr 4fr / 4fr 3fr;" data-expected-width="100" data-expected-height="200">
<div style="border: 2px solid lime;" data-expected-width="56" data-expected-height="86">XXX XX X</div>
<div class="secondRowSecondColumn" style="border: 2px solid navy;" data-expected-width="44" data-expected-height="114">XXXX XXX XXXX XXX XXXX</div>
</div>
</div>

</body>
42 changes: 42 additions & 0 deletions testing/web-platform/tests/css/support/height-keyword-classes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* In the current spec for heights, min-content, max-content and fit-content are
* equivalent.
*/

.min-content {
height: min-content;
}

.max-content {
height: max-content;
}

.fit-content {
height: -moz-fit-content;
height: fit-content;
}

.max-height-min-content {
max-height: min-content;
}

.max-height-max-content {
max-height: max-content;
}

.max-height-fit-content {
max-height: -moz-fit-content;
max-height: fit-content;
}

.min-height-min-content {
min-height: min-content;
}

.min-height-max-content {
min-height: max-content;
}

.min-height-fit-content {
min-height: -moz-fit-content;
min-height: fit-content;
}

0 comments on commit 4808191

Please sign in to comment.