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
|
<!DOCTYPE html>
<head>
<link href="resources/grid.css" rel="stylesheet"/>
<style>
.grid {
font: 10px/1 Ahem;
}
.gridContentSizedColumn {
grid-template-columns: minmax(min-content, 20px);
grid-template-rows: 10px;
}
.gridContentSizedColumnFreeSpace {
grid-template-columns: minmax(min-content, 100px);
grid-template-rows: 10px;
}
.gridContentSizedRow {
grid-template-columns: 40px;
grid-template-rows: minmax(max-content, 10px);
}
.gridContentSizedRowFreeSpace {
grid-template-columns: 40px;
grid-template-rows: minmax(max-content, 100px);
}
.definiteWidth { width: 80px; }
.definiteHeight { height: 80px; }
.indefiniteWidth { float: left; }
.indefiniteHeight { height: auto; }
</style>
<script src="resources/grid-definitions-parsing-utils.js"></script>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<!-- Grids with base-size > growth-limit -->
<div class="grid gridContentSizedColumn indefiniteWidth" id="gridContentSizedColumn">
<div class="firstRowFirstColumn">XXXXX</div>
</div>
<div class="grid gridContentSizedRow indefiniteHeight" id="gridContentSizedRow">
<div class="firstRowFirstColumn">XXXX XXXX</div>
</div>
<!-- Grids with base-size < growth-limit and some size constraints. -->
<div class="grid gridContentSizedColumnFreeSpace definiteWidth" id="gridContentSizedColumnFreeSpace">
<div class="firstRowFirstColumn">XX XX</div>
</div>
<div class="grid gridContentSizedRowFreeSpace definiteHeight" id="gridContentSizedRowFreeSpace">
<div class="firstRowFirstColumn">XXXX XXXX</div>
</div>
<div class="definiteWidth">
<div class="grid gridContentSizedColumnFreeSpace" id="gridContentSizedColumnFreeSpaceParentDefinite">
<div class="firstRowFirstColumn">XX XX</div>
</div>
</div>
<div class="definiteHeight">
<div class="grid gridContentSizedRowFreeSpace indefiniteHeight" id="gridContentSizedRowFreeSpaceParentDefinite">
<div class="firstRowFirstColumn">XXXX XXXX</div>
</div>
</div>
<script>
debug("Check that tracks are not shrinked if the available space is indefinite.");
testGridDefinitionsValues(document.getElementById("gridContentSizedColumn"), "50px", "10px");
testGridDefinitionsValues(document.getElementById("gridContentSizedRow"), "40px", "20px");
debug("");
debug("Check that tracks use the available free space if available.");
testGridDefinitionsValues(document.getElementById("gridContentSizedColumnFreeSpace"), "80px", "10px");
testGridDefinitionsValues(document.getElementById("gridContentSizedRowFreeSpace"), "40px", "80px");
testGridDefinitionsValues(document.getElementById("gridContentSizedColumnFreeSpaceParentDefinite"), "80px", "10px");
testGridDefinitionsValues(document.getElementById("gridContentSizedRowFreeSpaceParentDefinite"), "40px", "100px");
</script>
</body>
|