blob: 88ef52849d75562b07c09189659256d04960145f (
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
<!DOCTYPE html>
<html>
<link href="resources/grid.css" rel="stylesheet">
<link href="resources/grid-alignment.css" rel="stylesheet">
<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel=stylesheet>
<style>
.minWidthGrid {
min-width: 100px;
grid-template-columns: 50px;
grid-template-rows: 40px;
}
.maxWidthGrid {
max-width: 100px;
grid-template-columns: 150px 50px;
grid-template-rows: 40px;
}
.minWidthAutoGrid {
min-width: 100px;
}
.maxWidthAutoGrid {
max-width: 100px;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid')">
<p>Test that min-width and max-width are accounted for when computing the grid element's preferred widths.</p>
<div class="constrainedContainer">
<div class="grid minWidthGrid" data-expected-height="40" data-expected-width="100"></div>
<div class="grid minWidthAutoGrid justifyContentStart justfyContentStart" data-expected-height="10" data-expected-width="100">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="10" data-expected-width="70">XXX XXX</div>
</div>
<!-- These 2 grids are sized after their containing block as width is 'auto'. We end up having the content overflow which is weird but the grid shouldn't shrink to fit by default. -->
<div class="grid maxWidthGrid" data-expected-height="40" data-expected-width="10"></div>
<div class="grid maxWidthAutoGrid" data-expected-height="10" data-expected-width="10">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="10" data-expected-width="110">XXXXXXXXXXX</div>
</div>
<div class="grid fit-content minWidthGrid" data-expected-height="40" data-expected-width="100"></div>
<div class="grid fit-content maxWidthGrid" data-expected-height="40" data-expected-width="100"></div>
<div class="grid max-content minWidthAutoGrid" data-expected-height="10" data-expected-width="110">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="10" data-expected-width="110">XXX XXX XXX</div>
</div>
<div class="grid min-content minWidthAutoGrid" data-expected-height="20" data-expected-width="100">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="100">XXX XXX XXX</div>
</div>
<div class="grid max-content maxWidthAutoGrid" data-expected-height="20" data-expected-width="100">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="100">XXXXX XXXXXX</div>
</div>
<div class="grid min-content maxWidthAutoGrid" data-expected-height="20" data-expected-width="60">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="60">XXXXX XXXXXX</div>
</div>
</div>
<div class="unconstrainedContainer">
<div class="grid minWidthGrid" data-expected-height="40" data-expected-width="1000"></div>
<div class="grid minWidthAutoGrid justifyContentStart" data-expected-height="10" data-expected-width="1000">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="10" data-expected-width="70">XXX XXX</div>
</div>
<div class="grid maxWidthGrid" data-expected-height="40" data-expected-width="100"></div>
<div class="grid maxWidthAutoGrid" data-expected-height="20" data-expected-width="100">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="100">XXXXX XXXXXX</div>
</div>
<div class="grid fit-content minWidthGrid" data-expected-height="40" data-expected-width="100"></div>
<div class="grid fit-content maxWidthGrid" data-expected-height="40" data-expected-width="100"></div>
<div class="grid max-content minWidthAutoGrid" data-expected-height="10" data-expected-width="110">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="10" data-expected-width="110">XXX XXX XXX</div>
</div>
<div class="grid min-content minWidthAutoGrid" data-expected-height="20" data-expected-width="100">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="100">XXX XXX XXX</div>
</div>
<div class="grid max-content maxWidthAutoGrid" data-expected-height="20" data-expected-width="100">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="100">XXXXX XXXXXX</div>
</div>
<div class="grid min-content maxWidthAutoGrid" data-expected-height="20" data-expected-width="60">
<div class="sizedToGridArea firstRowFirstColumn" data-expected-height="20" data-expected-width="60">XXXXX XXXXXX</div>
</div>
</div>
</body>
</html>
|