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
89
90
|
<!DOCTYPE HTML>
<link href="resources/grid.css" rel="stylesheet">
<link href="resources/grid-alignment.css" rel="stylesheet">
<style>
.grid {
font: 50px/1 Ahem;
}
.singleNamedGridLines {
grid-template-columns: [a] auto [b];
grid-template-rows: [x] auto [y];
}
.multipleNamedGridLines {
grid-template-columns: [a b c] auto [d e];
grid-template-rows: [x y z] auto [v w];
}
</style>
<script src="../../resources/js-test.js"></script>
<div class="grid singleNamedGridLines justifyContentStart" id="gridOneColumnSingle">
<div>XXXX</div>
<div>XXX</div>
<div>XX</div>
<div>X</div>
</div>
<div class="grid singleNamedGridLines justifyContentStart" id="gridTwoColumnsSingle">
<div class="firstRowAutoColumn">XXXX</div>
<div class="firstRowAutoColumn">XXX</div>
<div>XX</div>
<div>X</div>
</div>
<div class="grid singleNamedGridLines justifyContentStart" id="gridThreeColumnsSingle">
<div class="firstRowAutoColumn">XXXX</div>
<div class="firstRowAutoColumn">XXX</div>
<div class="firstRowAutoColumn">XX</div>
<div>X</div>
</div>
<div class="grid singleNamedGridLines justifyContentStart" id="gridFourColumnsSingle">
<div class="firstRowAutoColumn">XXXX</div>
<div class="firstRowAutoColumn">XXX</div>
<div class="firstRowAutoColumn">XX</div>
<div class="firstRowAutoColumn">X</div>
</div>
<div class="grid multipleNamedGridLines justifyContentStart" id="gridOneColumnMultiple">
<div>XXXX</div>
<div>XXX</div>
<div>XX</div>
<div>X</div>
</div>
<div class="grid multipleNamedGridLines justifyContentStart" id="gridTwoColumnsMultiple">
<div class="firstRowAutoColumn">XXXX</div>
<div class="firstRowAutoColumn">XXX</div>
<div>XX</div>
<div>X</div>
</div>
<div class="grid multipleNamedGridLines justifyContentStart" id="gridThreeColumnsMultiple">
<div class="firstRowAutoColumn">XXXX</div>
<div class="firstRowAutoColumn">XXX</div>
<div class="firstRowAutoColumn">XX</div>
<div>X</div>
</div>
<div class="grid multipleNamedGridLines justifyContentStart" id="gridFourColumnsMultiple">
<div class="firstRowAutoColumn">XXXX</div>
<div class="firstRowAutoColumn">XXX</div>
<div class="firstRowAutoColumn">XX</div>
<div class="firstRowAutoColumn">X</div>
</div>
<script src="resources/grid-definitions-parsing-utils.js"></script>
<script>
description("Test that computed style for grid-template-columns and grid-template-rows works as expected with named grid lines and implicit tracks");
testGridDefinitionsValues(document.getElementById("gridOneColumnSingle"), "[a] 200px [b]", "[x] 50px [y] 50px 50px 50px");
testGridDefinitionsValues(document.getElementById("gridTwoColumnsSingle"), "[a] 200px [b] 150px", "[x] 50px [y] 50px");
testGridDefinitionsValues(document.getElementById("gridThreeColumnsSingle"), "[a] 200px [b] 150px 100px", "[x] 50px [y] 50px");
testGridDefinitionsValues(document.getElementById("gridFourColumnsSingle"), "[a] 200px [b] 150px 100px 50px", "[x] 50px [y]");
testGridDefinitionsValues(document.getElementById("gridOneColumnMultiple"), "[a b c] 200px [d e]", "[x y z] 50px [v w] 50px 50px 50px");
testGridDefinitionsValues(document.getElementById("gridTwoColumnsMultiple"), "[a b c] 200px [d e] 150px", "[x y z] 50px [v w] 50px");
testGridDefinitionsValues(document.getElementById("gridThreeColumnsMultiple"), "[a b c] 200px [d e] 150px 100px", "[x y z] 50px [v w] 50px");
testGridDefinitionsValues(document.getElementById("gridFourColumnsMultiple"), "[a b c] 200px [d e] 150px 100px 50px", "[x y z] 50px [v w]");
</script>
|