| OLD | NEW |
| 1 description('Test that setting and getting grid-definition-columns and grid-defi
nition-rows works as expected'); | 1 description('Test that setting and getting grid-definition-columns and grid-defi
nition-rows works as expected'); |
| 2 | 2 |
| 3 debug("Test getting grid-definition-columns and grid-definition-rows set through
CSS"); | 3 debug("Test getting grid-definition-columns and grid-definition-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"), "53
%", "27%"); | 6 testGridDefinitionsValues(document.getElementById("gridWithPercentElement"), "53
%", "27%"); |
| 7 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "auto"
, "auto"); | 7 testGridDefinitionsValues(document.getElementById("gridWithAutoElement"), "auto"
, "auto"); |
| 8 testGridDefinitionsValues(document.getElementById("gridWithEMElement"), "100px",
"150px"); | 8 testGridDefinitionsValues(document.getElementById("gridWithEMElement"), "100px",
"150px"); |
| 9 testGridDefinitionsValues(document.getElementById("gridWithViewPortPercentageEle
ment"), "64px", "60px"); | 9 testGridDefinitionsValues(document.getElementById("gridWithViewPortPercentageEle
ment"), "64px", "60px"); |
| 10 testGridDefinitionsValues(document.getElementById("gridWithMinMax"), "minmax(10%
, 15px)", "minmax(20px, 50%)"); | 10 testGridDefinitionsValues(document.getElementById("gridWithMinMax"), "minmax(10%
, 15px)", "minmax(20px, 50%)"); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 debug(""); | 74 debug(""); |
| 75 debug("Test setting grid-definition-columns and grid-definition-rows back to 'no
ne' through JS"); | 75 debug("Test setting grid-definition-columns and grid-definition-rows back to 'no
ne' through JS"); |
| 76 testNonGridDefinitionsSetJSValues("18px", "66px"); | 76 testNonGridDefinitionsSetJSValues("18px", "66px"); |
| 77 testNonGridDefinitionsSetJSValues("none", "none"); | 77 testNonGridDefinitionsSetJSValues("none", "none"); |
| 78 | 78 |
| 79 function testInherit() | 79 function testInherit() |
| 80 { | 80 { |
| 81 var parentElement = document.createElement("div"); | 81 var parentElement = document.createElement("div"); |
| 82 document.body.appendChild(parentElement); | 82 document.body.appendChild(parentElement); |
| 83 parentElement.style.gridDefinitionColumns = "50px 'last'"; | 83 parentElement.style.gridDefinitionColumns = "50px (last)"; |
| 84 parentElement.style.gridDefinitionRows = "'first' 101%"; | 84 parentElement.style.gridDefinitionRows = "(first) 101%"; |
| 85 | 85 |
| 86 element = document.createElement("div"); | 86 element = document.createElement("div"); |
| 87 parentElement.appendChild(element); | 87 parentElement.appendChild(element); |
| 88 element.style.gridDefinitionColumns = "inherit"; | 88 element.style.gridDefinitionColumns = "inherit"; |
| 89 element.style.gridDefinitionRows = "inherit"; | 89 element.style.gridDefinitionRows = "inherit"; |
| 90 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co
lumns')", "'50px last'"); | 90 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co
lumns')", "'50px (last)'"); |
| 91 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro
ws')", "'first 101%'"); | 91 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro
ws')", "'(first) 101%'"); |
| 92 | 92 |
| 93 document.body.removeChild(parentElement); | 93 document.body.removeChild(parentElement); |
| 94 } | 94 } |
| 95 debug(""); | 95 debug(""); |
| 96 debug("Test setting grid-definition-columns and grid-definition-rows to 'inherit
' through JS"); | 96 debug("Test setting grid-definition-columns and grid-definition-rows to 'inherit
' through JS"); |
| 97 testInherit(); | 97 testInherit(); |
| 98 | 98 |
| 99 function testInitial() | 99 function testInitial() |
| 100 { | 100 { |
| 101 element = document.createElement("div"); | 101 element = document.createElement("div"); |
| 102 document.body.appendChild(element); | 102 document.body.appendChild(element); |
| 103 element.style.gridDefinitionColumns = "150% 'last'"; | 103 element.style.gridDefinitionColumns = "150% (last)"; |
| 104 element.style.gridDefinitionRows = "'first' 1fr"; | 104 element.style.gridDefinitionRows = "(first) 1fr"; |
| 105 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co
lumns')", "'150% last'"); | 105 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co
lumns')", "'150% (last)'"); |
| 106 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro
ws')", "'first 1fr'"); | 106 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro
ws')", "'(first) 1fr'"); |
| 107 | 107 |
| 108 element.style.gridDefinitionColumns = "initial"; | 108 element.style.gridDefinitionColumns = "initial"; |
| 109 element.style.gridDefinitionRows = "initial"; | 109 element.style.gridDefinitionRows = "initial"; |
| 110 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co
lumns')", "'none'"); | 110 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-co
lumns')", "'none'"); |
| 111 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro
ws')", "'none'"); | 111 shouldBe("getComputedStyle(element, '').getPropertyValue('grid-definition-ro
ws')", "'none'"); |
| 112 | 112 |
| 113 document.body.removeChild(element); | 113 document.body.removeChild(element); |
| 114 } | 114 } |
| 115 debug(""); | 115 debug(""); |
| 116 debug("Test setting grid-definition-columns and grid-definition-rows to 'initial
' through JS"); | 116 debug("Test setting grid-definition-columns and grid-definition-rows to 'initial
' through JS"); |
| 117 testInitial(); | 117 testInitial(); |
| OLD | NEW |