OLD | NEW |
1 description('Test that setting and getting grid-template-columns and grid-templa
te-rows works as expected'); | 1 description('Test that setting and getting grid-template-columns and grid-templa
te-rows works as expected'); |
2 | 2 |
3 debug("Test getting grid-template-columns and grid-template-rows set through CSS
"); | 3 debug("Test getting grid-template-columns and grid-template-rows set through CSS
"); |
4 testGridDefinitionsValues(document.getElementById("gridWithNoneElement"), "none"
, "none"); | 4 testGridDefinitionsValues(document.getElementById("gridWithNoneElement"), "none"
, "none"); |
5 testGridDefinitionsValues(document.getElementById("gridWithFixedElement"), "10px
", "15px"); | 5 testGridDefinitionsValues(document.getElementById("gridWithFixedElement"), "10px
", "15px"); |
6 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "40
0px", "150px"); | 6 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "40
0px", "150px"); |
7 testGridDefinitionsValues(document.getElementById("gridWithPercentWithoutSize"),
"0px", "0px"); | 7 testGridDefinitionsValues(document.getElementById("gridWithPercentWithoutSize"),
"0px", "0px"); |
8 testGridDefinitionsValues(document.getElementById("gridWithPercentWithoutSizeWit
hChildren"), "7px", "11px"); | 8 testGridDefinitionsValues(document.getElementById("gridWithPercentWithoutSizeWit
hChildren"), "7px", "11px"); |
9 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "0px",
"0px"); | 9 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "0px",
"0px"); |
10 testGridDefinitionsValues(document.getElementById("gridWithAutoWithoutSizeElemen
t"), "0px", "0px"); | 10 testGridDefinitionsValues(document.getElementById("gridWithAutoWithoutSizeElemen
t"), "0px", "0px"); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 testGridDefinitionsSetBadJSValues("0fr", "1r"); | 83 testGridDefinitionsSetBadJSValues("0fr", "1r"); |
84 // A dimension doesn't allow spaces between the number and the unit. | 84 // A dimension doesn't allow spaces between the number and the unit. |
85 testGridDefinitionsSetBadJSValues(".0000fr", "13 fr"); | 85 testGridDefinitionsSetBadJSValues(".0000fr", "13 fr"); |
86 testGridDefinitionsSetBadJSValues("7.-fr", "-8,0fr"); | 86 testGridDefinitionsSetBadJSValues("7.-fr", "-8,0fr"); |
87 // Negative values are not allowed. | 87 // Negative values are not allowed. |
88 testGridDefinitionsSetBadJSValues("-1px", "-6em"); | 88 testGridDefinitionsSetBadJSValues("-1px", "-6em"); |
89 testGridDefinitionsSetBadJSValues("minmax(-1%, 32%)", "minmax(2vw, -6em)"); | 89 testGridDefinitionsSetBadJSValues("minmax(-1%, 32%)", "minmax(2vw, -6em)"); |
90 // Invalid expressions with calc | 90 // Invalid expressions with calc |
91 testGridDefinitionsSetBadJSValues("calc(16px 30px)", "calc(25px + auto)"); | 91 testGridDefinitionsSetBadJSValues("calc(16px 30px)", "calc(25px + auto)"); |
92 testGridDefinitionsSetBadJSValues("minmax(min-content, calc())", "calc(10%("); | 92 testGridDefinitionsSetBadJSValues("minmax(min-content, calc())", "calc(10%("); |
| 93 // Forward slash not allowed if not part of a shorthand |
| 94 testGridDefinitionsSetBadJSValues("10px /", "15px /"); |
93 | 95 |
94 debug(""); | 96 debug(""); |
95 debug("Test setting grid-template-columns and grid-template-rows back to 'none'
through JS"); | 97 debug("Test setting grid-template-columns and grid-template-rows back to 'none'
through JS"); |
96 testGridDefinitionsSetJSValues("18px", "66px"); | 98 testGridDefinitionsSetJSValues("18px", "66px"); |
97 testGridDefinitionsSetJSValues("none", "none"); | 99 testGridDefinitionsSetJSValues("none", "none"); |
98 | 100 |
99 function testInherit() | 101 function testInherit() |
100 { | 102 { |
101 var parentElement = document.createElement("div"); | 103 var parentElement = document.createElement("div"); |
102 document.body.appendChild(parentElement); | 104 document.body.appendChild(parentElement); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 element.style.gridTemplateColumns = "initial"; | 136 element.style.gridTemplateColumns = "initial"; |
135 element.style.gridTemplateRows = "initial"; | 137 element.style.gridTemplateRows = "initial"; |
136 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu
mns')", "'none'"); | 138 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-colu
mns')", "'none'"); |
137 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows
')", "'none'"); | 139 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-template-rows
')", "'none'"); |
138 | 140 |
139 document.body.removeChild(element); | 141 document.body.removeChild(element); |
140 } | 142 } |
141 debug(""); | 143 debug(""); |
142 debug("Test setting grid-template-columns and grid-template-rows to 'initial' th
rough JS"); | 144 debug("Test setting grid-template-columns and grid-template-rows to 'initial' th
rough JS"); |
143 testInitial(); | 145 testInitial(); |
OLD | NEW |