| 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: 10px / 15px; | 10 grid: 10px / 15px; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 debug(""); | 86 debug(""); |
| 87 debug("Test getting wrong values for 'grid' shorthand through CSS (they shou
ld resolve to the default: 'none')"); | 87 debug("Test getting wrong values for 'grid' shorthand through CSS (they shou
ld resolve to the default: 'none')"); |
| 88 testGridDefinitionsValues(document.getElementById("gridWithExplicitAndImplic
it"), "none", "none", "none", "row", "auto", "auto"); | 88 testGridDefinitionsValues(document.getElementById("gridWithExplicitAndImplic
it"), "none", "none", "none", "row", "auto", "auto"); |
| 89 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone1"),
"none", "none", "none", "row", "auto", "auto"); | 89 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone1"),
"none", "none", "none", "row", "auto", "auto"); |
| 90 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone2"),
"none", "none", "none", "row", "auto", "auto"); | 90 testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone2"),
"none", "none", "none", "row", "auto", "auto"); |
| 91 testGridDefinitionsValues(document.getElementById("gridWithMisplacedDense"),
"none", "none", "none", "row", "auto", "auto"); | 91 testGridDefinitionsValues(document.getElementById("gridWithMisplacedDense"),
"none", "none", "none", "row", "auto", "auto"); |
| 92 | 92 |
| 93 debug(""); | 93 debug(""); |
| 94 debug("Test getting and setting 'grid' shorthand through JS"); | 94 debug("Test getting and setting 'grid' shorthand through JS"); |
| 95 testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row",
"auto", "auto", "10px", "20px", "none", "initial", "initial", "initial"); | 95 testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row",
"auto", "auto", "10px", "20px", "none", "row", "auto", "auto"); |
| 96 testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20p
x", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "
initial", "initial"); | 96 testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20p
x", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "row", "auto
", "auto"); |
| 97 testGridDefinitionsSetJSValues("row dense 20px", "none", "none", "none", "ro
w dense", "20px", "20px", "initial", "initial", "initial", "row dense", "20px",
"20px"); | 97 testGridDefinitionsSetJSValues("row dense 20px", "none", "none", "none", "ro
w dense", "20px", "20px", "none", "none", "none", "row dense", "20px", "20px"); |
| 98 testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none",
"column", "10px", "20px", "initial", "initial", "initial", "column", "10px", "2
0px"); | 98 testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none",
"column", "10px", "20px", "none", "none", "none", "column", "10px", "20px"); |
| 99 | 99 |
| 100 debug(""); | 100 debug(""); |
| 101 debug("Test the initial value"); | 101 debug("Test the initial value"); |
| 102 var element = document.createElement("div"); | 102 var element = document.createElement("div"); |
| 103 document.body.appendChild(element); | 103 document.body.appendChild(element); |
| 104 testGridDefinitionsValues(element, "none", "none", "none", "row", "auto", "a
uto"); | 104 testGridDefinitionsValues(element, "none", "none", "none", "row", "auto", "a
uto"); |
| 105 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu
mns')", "'none'"); | 105 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu
mns')", "'none'"); |
| 106 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows
')", "'none'"); | 106 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows
')", "'none'"); |
| 107 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-area
s')", "'none'"); | 107 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-area
s')", "'none'"); |
| 108 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-flow')",
"'row'"); | 108 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-flow')",
"'row'"); |
| 109 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-columns'
)", "'auto'"); | 109 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-columns'
)", "'auto'"); |
| 110 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-rows')",
"'auto'"); | 110 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-auto-rows')",
"'auto'"); |
| 111 | 111 |
| 112 debug(""); | 112 debug(""); |
| 113 debug("Test setting grid-template-columns and grid-template-rows back to 'no
ne' through JS"); | 113 debug("Test setting grid-template-columns and grid-template-rows back to 'no
ne' through JS"); |
| 114 testGridDefinitionsSetJSValues("column 10px / 20px", "none", "none", "none",
"column", "20px", "10px", "initial", "initial", "initial", "column", "20px", "1
0px"); | 114 testGridDefinitionsSetJSValues("column 10px / 20px", "none", "none", "none",
"column", "20px", "10px", "none", "none", "none", "column", "20px", "10px"); |
| 115 testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto"
, "auto", "none", "none", "none", "initial", "initial", "initial"); | 115 testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto"
, "auto", "none", "none", "none", "row", "auto", "auto"); |
| 116 | 116 |
| 117 debug(""); | 117 debug(""); |
| 118 debug("Test the inherit value on reset-only subproperties (grid-*-gap)"); | 118 debug("Test the inherit value on reset-only subproperties (grid-*-gap)"); |
| 119 document.body.style.gridRowGap = "100px"; | 119 document.body.style.gridRowGap = "100px"; |
| 120 document.body.style.gridColumnGap = "20px"; | 120 document.body.style.gridColumnGap = "20px"; |
| 121 var anotherElement = document.createElement("div"); | 121 var anotherElement = document.createElement("div"); |
| 122 document.body.appendChild(anotherElement); | 122 document.body.appendChild(anotherElement); |
| 123 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "0px"); | 123 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "0px"); |
| 124 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "0px"); | 124 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "0px"); |
| 125 anotherElement.style.grid = "inherit"; | 125 anotherElement.style.grid = "inherit"; |
| 126 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "20px"); | 126 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-column-gap')", "20px"); |
| 127 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "100px"); | 127 shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue
('grid-row-gap')", "100px"); |
| 128 </script> | 128 </script> |
| 129 </body> | 129 </body> |
| 130 </html> | 130 </html> |
| OLD | NEW |