summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/contain-size-grid-006.html
blob: 7bfbac1c6c7fb0bc0f97957a402981193dbd1585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Test: 'contain: size' on grid elements should cause them to be sized as if they had no contents.</title>
<link rel="author" title="Ethan Jimenez" href="mailto:ethavar@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-contain/#containment-size">
<style>
.grid {
  display: inline-grid;
  contain: size;
  border: 5px solid green;
  background: lightblue;
}
.item {
  color: transparent;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  height: 100px;
  width: 100px;
}
.min-size {
  min-height: 55px;
  min-width: 55px;
}
.max-size {
  max-height: 70px;
  max-width: 70px;
}
.auto-tracks {
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
}
.fixed-tracks {
  grid-template-columns: 70px 30px;
  grid-template-rows: 30px 70px;
}
.fr-tracks {
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 2fr 1fr;
}
.auto-repeat-tracks {
  grid-template-columns: repeat(auto-fill, 40px);
  grid-template-rows: repeat(auto-fill, 40px);
}
</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('.grid')">
<div id="log"></div>

<div class="grid auto-tracks" data-expected-height="10" data-expected-width="10"><div class="item"></div></div>
<div class="grid min-size auto-tracks" data-expected-height="65" data-expected-width="65"><div class="item"></div></div>
<div class="grid max-size auto-tracks" data-expected-height="10" data-expected-width="10"><div class="item"></div></div>
<div class="grid min-size max-size auto-tracks" data-expected-height="65" data-expected-width="65"><div class="item"></div></div>

<div class="grid fixed-tracks" data-expected-height="110" data-expected-width="110"><div class="item"></div></div>
<div class="grid min-size fixed-tracks" data-expected-height="110" data-expected-width="110"><div class="item"></div></div>
<div class="grid max-size fixed-tracks" data-expected-height="80" data-expected-width="80"><div class="item"></div></div>
<div class="grid min-size max-size fixed-tracks" data-expected-height="80" data-expected-width="80"><div class="item"></div></div>

<div class="grid fr-tracks" data-expected-height="10" data-expected-width="10"><div class="item"></div></div>
<div class="grid min-size fr-tracks" data-expected-height="65" data-expected-width="65"><div class="item"></div></div>
<div class="grid max-size fr-tracks" data-expected-height="10" data-expected-width="10"><div class="item"></div></div>
<div class="grid min-size max-size fr-tracks" data-expected-height="65" data-expected-width="65"><div class="item"></div></div>

<div class="grid auto-repeat-tracks" data-expected-height="50" data-expected-width="50"><div class="item"></div></div>
<div class="grid min-size auto-repeat-tracks" data-expected-height="90" data-expected-width="90"><div class="item"></div></div>
<div class="grid max-size auto-repeat-tracks" data-expected-height="50" data-expected-width="50"><div class="item"></div></div>
<div class="grid min-size max-size auto-repeat-tracks" data-expected-height="65" data-expected-width="65"><div class="item"></div></div>
</body>
</html>