OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
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 #gridWithNone { | 6 #gridWithNone { |
7 grid: none; | 7 grid: none; |
8 } | 8 } |
9 .gridWithTemplate { | 9 .gridWithTemplate { |
10 grid: 15px / 10px; | 10 grid: 10px / 15px; |
11 } | 11 } |
12 .gridWithInherit { | 12 .gridWithInherit { |
13 grid: inherit; | 13 grid: inherit; |
14 } | 14 } |
15 #gridWithAutoFlowAndColumns { | 15 #gridWithAutoFlowAndColumns { |
16 grid: column 10px; | 16 grid: column 10px; |
17 } | 17 } |
18 #gridWithAutoFlowNone { | 18 #gridWithAutoFlowNone { |
19 grid: none 10px; | 19 grid: none 10px; |
20 } | 20 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 debug(""); | 81 debug(""); |
82 debug("Test getting wrong values for 'grid' shorthand through CSS (they shou
ld resolve to the default: 'none')"); | 82 debug("Test getting wrong values for 'grid' shorthand through CSS (they shou
ld resolve to the default: 'none')"); |
83 testGridDefinitionsValues(document.getElementById("gridWithExplicitAndImplic
it"), "none", "none", "none", "row", "auto", "auto"); | 83 testGridDefinitionsValues(document.getElementById("gridWithExplicitAndImplic
it"), "none", "none", "none", "row", "auto", "auto"); |
84 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone1"),
"none", "none", "none", "row", "auto", "auto"); | 84 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone1"),
"none", "none", "none", "row", "auto", "auto"); |
85 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone2"),
"none", "none", "none", "row", "auto", "auto"); | 85 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone2"),
"none", "none", "none", "row", "auto", "auto"); |
86 testGridDefinitionsValues(document.getElementById("gridWithMisplacedDense"),
"none", "none", "none", "row", "auto", "auto"); | 86 testGridDefinitionsValues(document.getElementById("gridWithMisplacedDense"),
"none", "none", "none", "row", "auto", "auto"); |
87 | 87 |
88 debug(""); | 88 debug(""); |
89 debug("Test getting and setting 'grid' shorthand through JS"); | 89 debug("Test getting and setting 'grid' shorthand through JS"); |
90 testGridDefinitionsSetJSValues("10px / 20px", "10px", "20px", "none", "row",
"auto", "auto", "10px", "20px", "none", "initial", "initial", "initial"); | 90 testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row",
"auto", "auto", "10px", "20px", "none", "initial", "initial", "initial"); |
91 testGridDefinitionsSetJSValues("10px / [line] 'a' 20px", "10px", "[line] 20p
x", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "
initial", "initial"); | 91 testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20p
x", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "
initial", "initial"); |
92 testGridDefinitionsSetJSValues("row dense 20px", "none", "none", "none", "ro
w dense", "20px", "20px", "initial", "initial", "initial", "row dense", "20px",
"20px"); | 92 testGridDefinitionsSetJSValues("row dense 20px", "none", "none", "none", "ro
w dense", "20px", "20px", "initial", "initial", "initial", "row dense", "20px",
"20px"); |
93 testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none",
"column", "20px", "10px", "initial", "initial", "initial", "column", "20px", "1
0px"); | 93 testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none",
"column", "20px", "10px", "initial", "initial", "initial", "column", "20px", "1
0px"); |
94 | 94 |
95 debug(""); | 95 debug(""); |
96 debug("Test the initial value"); | 96 debug("Test the initial value"); |
97 var element = document.createElement("div"); | 97 var element = document.createElement("div"); |
98 document.body.appendChild(element); | 98 document.body.appendChild(element); |
99 testGridDefinitionsValues(element, "none", "none", "none", "row", "auto", "a
uto"); | 99 testGridDefinitionsValues(element, "none", "none", "none", "row", "auto", "a
uto"); |
100 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu
mns')", "'none'"); | 100 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu
mns')", "'none'"); |
101 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows
')", "'none'"); | 101 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows
')", "'none'"); |
(...skipping 14 matching lines...) Expand all Loading... |
116 var anotherElement = document.createElement("div"); | 116 var anotherElement = document.createElement("div"); |
117 document.body.appendChild(anotherElement); | 117 document.body.appendChild(anotherElement); |
118 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "0px"); | 118 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "0px"); |
119 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "0px"); | 119 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "0px"); |
120 anotherElement.style.grid = "inherit"; | 120 anotherElement.style.grid = "inherit"; |
121 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "20px"); | 121 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "20px"); |
122 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "100px"); | 122 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "100px"); |
123 </script> | 123 </script> |
124 </body> | 124 </body> |
125 </html> | 125 </html> |
OLD | NEW |