OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link href="resources/grid.css" rel="stylesheet"> | 4 <link href="resources/grid.css" rel="stylesheet"> |
5 <style> | 5 <style> |
6 .gridAutoFixedFixed { | 6 .gridAutoFixedFixed { |
7 grid-auto-rows: 30px; | 7 grid-auto-rows: 30px; |
8 grid-auto-columns: 50px; | 8 grid-auto-columns: 50px; |
9 } | 9 } |
10 | 10 |
11 .gridAutoMinMax { | 11 .gridAutoMinMax { |
12 grid-auto-rows: minmax(10%, 15px); | 12 grid-auto-rows: minmax(10%, 15px); |
13 grid-auto-columns: minmax(30%, 100px); | 13 grid-auto-columns: minmax(30%, 100px); |
14 } | 14 } |
15 | 15 |
16 .gridAutoMinMaxContent { | 16 .gridAutoMinMaxContent { |
17 grid-auto-rows: min-content; | 17 grid-auto-rows: min-content; |
18 grid-auto-columns: max-content; | 18 grid-auto-columns: max-content; |
19 } | 19 } |
| 20 |
| 21 .gridAutoFixedFixedWithFixedFixed { |
| 22 grid-auto-rows: 30px; |
| 23 grid-auto-columns: 40px; |
| 24 grid-template-rows: 15px; |
| 25 grid-template-columns: 20px; |
| 26 } |
| 27 |
20 </style> | 28 </style> |
21 <script src="../../resources/js-test.js"></script> | 29 <script src="../../resources/js-test.js"></script> |
| 30 <script src="resources/grid-definitions-parsing-utils.js"></script> |
22 </head> | 31 </head> |
23 <body> | 32 <body> |
24 <div class="grid gridAutoFixedFixed" id="gridAutoFixedFixed"></div> | 33 <div class="grid gridAutoFixedFixed" id="gridAutoFixedFixed"></div> |
25 <div class="grid gridAutoMinMax" id="gridAutoMinMax"></div> | 34 <div class="grid gridAutoMinMax" id="gridAutoMinMax"></div> |
26 <div class="grid gridAutoMinMaxContent" id="gridAutoMinMaxContent"></div> | 35 <div class="grid gridAutoMinMaxContent" id="gridAutoMinMaxContent"></div> |
| 36 <div class="grid gridAutoFixedFixed" id="gridAutoFixedFixedWithChildren"> |
| 37 <div class="sizedToGridArea firstRowFirstColumn"></div> |
| 38 </div> |
| 39 <div class="grid gridAutoFixedFixedWithFixedFixed" id="gridAutoFixedFixedWithFix
edFixedWithChildren"> |
| 40 <div class="sizedToGridArea thirdRowAutoColumn"></div> |
| 41 <div class="sizedToGridArea autoRowThirdColumn"></div> |
| 42 </div> |
27 <script> | 43 <script> |
28 description('Test that setting and getting grid-auto-columns and grid-auto-rows
works as expected'); | 44 description('Test that setting and getting grid-auto-columns and grid-auto-rows
works as expected'); |
29 | 45 |
30 debug("Test getting grid-auto-columns and grid-auto-rows set through CSS"); | 46 debug("Test getting grid-auto-columns and grid-auto-rows set through CSS"); |
31 var gridAutoFixedFixed = document.getElementById("gridAutoFixedFixed"); | 47 testGridAutoDefinitionsValues(document.getElementById("gridAutoFixedFixed"), "30
px", "50px"); |
32 shouldBe("getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('grid-auto-r
ows')", "'30px'"); | 48 testGridAutoDefinitionsValues(document.getElementById("gridAutoMinMax"), "minmax
(10%, 15px)", "minmax(30%, 100px)"); |
33 shouldBe("getComputedStyle(gridAutoFixedFixed, '').getPropertyValue('grid-auto-c
olumns')", "'50px'"); | 49 testGridAutoDefinitionsValues(document.getElementById("gridAutoMinMaxContent"),
"min-content", "max-content"); |
34 | 50 |
35 var gridAutoMinMax = document.getElementById("gridAutoMinMax"); | 51 debug(""); |
36 shouldBe("getComputedStyle(gridAutoMinMax, '').getPropertyValue('grid-auto-rows'
)", "'minmax(10%, 15px)'"); | 52 debug("Test that getting grid-template-columns and grid-template-rows set throug
h CSS lists every track listed whether implicitly or explicitly created"); |
37 shouldBe("getComputedStyle(gridAutoMinMax, '').getPropertyValue('grid-auto-colum
ns')", "'minmax(30%, 100px)'"); | 53 testGridAutoDefinitionsValues(document.getElementById("gridAutoFixedFixedWithChi
ldren"), "30px", "50px"); |
| 54 testGridDefinitionsValues(document.getElementById("gridAutoFixedFixedWithChildre
n"), "50px", "30px"); |
| 55 testGridAutoDefinitionsValues(document.getElementById("gridAutoFixedFixedWithFix
edFixedWithChildren"), "30px", "40px"); |
| 56 testGridDefinitionsValues(document.getElementById("gridAutoFixedFixedWithFixedFi
xedWithChildren"), "20px", "15px", "20px 40px 40px", "15px 30px 30px"); |
38 | 57 |
39 var gridAutoMinMaxContent = document.getElementById("gridAutoMinMaxContent"); | 58 debug(""); |
40 shouldBe("getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('grid-aut
o-rows')", "'min-content'"); | 59 debug("Test that grid-template-* definitions are not affected by grid-auto-* def
initions"); |
41 shouldBe("getComputedStyle(gridAutoMinMaxContent, '').getPropertyValue('grid-aut
o-columns')", "'max-content'"); | 60 testGridDefinitionsValues(document.getElementById("gridAutoFixedFixed"), "none",
"none"); |
| 61 testGridDefinitionsValues(document.getElementById("gridAutoMinMax"), "none", "no
ne"); |
| 62 testGridDefinitionsValues(document.getElementById("gridAutoMinMaxContent"), "non
e", "none"); |
42 | 63 |
43 debug(""); | 64 debug(""); |
44 debug("Test the initial value"); | 65 debug("Test the initial value"); |
45 var element = document.createElement("div"); | 66 var element = document.createElement("div"); |
46 document.body.appendChild(element); | 67 document.body.appendChild(element); |
47 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-columns')",
"'auto'"); | 68 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-columns')",
"'auto'"); |
48 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-rows')", "'a
uto'"); | 69 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-rows')", "'a
uto'"); |
49 | 70 |
50 debug(""); | 71 debug(""); |
51 debug("Test getting and setting grid-auto-columns and grid-auto-rows through JS"
); | 72 debug("Test getting and setting grid-auto-columns and grid-auto-rows through JS"
); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-rows')",
"'auto'"); | 170 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-rows')",
"'auto'"); |
150 | 171 |
151 document.body.removeChild(element); | 172 document.body.removeChild(element); |
152 } | 173 } |
153 debug(""); | 174 debug(""); |
154 debug("Test setting grid-auto-columns and grid-auto-rows to 'initial' through JS
"); | 175 debug("Test setting grid-auto-columns and grid-auto-rows to 'initial' through JS
"); |
155 testInitial(); | 176 testInitial(); |
156 </script> | 177 </script> |
157 </body> | 178 </body> |
158 </html> | 179 </html> |
OLD | NEW |