| OLD | NEW |
| 1 function testGridDefinitionsValues(element, columnValue, rowValue) | 1 function testGridDefinitionsValues(element, columnValue, rowValue) |
| 2 { | 2 { |
| 3 window.element = element; | 3 window.element = element; |
| 4 var elementID = element.id || "element"; | 4 var elementID = element.id || "element"; |
| 5 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-columns')", columnValue); | 5 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-columns')", columnValue); |
| 6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-rows')", rowValue); | 6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-rows')", rowValue); |
| 7 } | 7 } |
| 8 | 8 |
| 9 function testGridDefinitionsSetJSValues(columnValue, rowValue, computedColumnVal
ue, computedRowValue, jsColumnValue, jsRowValue) | 9 function testGridDefinitionsSetJSValues(columnValue, rowValue, computedColumnVal
ue, computedRowValue, jsColumnValue, jsRowValue) |
| 10 { | 10 { |
| 11 checkGridDefinitionsSetJSValues(true, columnValue, rowValue, computedColumnV
alue, computedRowValue, jsColumnValue, jsRowValue); | 11 checkGridDefinitionsSetJSValues(true, columnValue, rowValue, computedColumnV
alue, computedRowValue, jsColumnValue, jsRowValue); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function testNonGridDefinitionsSetJSValues(columnValue, rowValue, computedColumn
Value, computedRowValue, jsColumnValue, jsRowValue) | 14 function testNonGridDefinitionsSetJSValues(columnValue, rowValue, computedColumn
Value, computedRowValue, jsColumnValue, jsRowValue) |
| 15 { | 15 { |
| 16 checkGridDefinitionsSetJSValues(false, columnValue, rowValue, computedColumn
Value, computedRowValue, jsColumnValue, jsRowValue); | 16 checkGridDefinitionsSetJSValues(false, columnValue, rowValue, computedColumn
Value, computedRowValue, jsColumnValue, jsRowValue); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function checkGridDefinitionsSetJSValues(useGrid, columnValue, rowValue, compute
dColumnValue, computedRowValue, jsColumnValue, jsRowValue) | 19 function checkGridDefinitionsSetJSValues(useGrid, columnValue, rowValue, compute
dColumnValue, computedRowValue, jsColumnValue, jsRowValue) |
| 20 { | 20 { |
| 21 window.element = document.createElement("div"); | 21 window.element = document.createElement("div"); |
| 22 document.body.appendChild(element); | 22 document.body.appendChild(element); |
| 23 if (useGrid) { | 23 if (useGrid) { |
| 24 element.style.display = "grid"; | 24 element.style.display = "grid"; |
| 25 element.style.width = "800px"; | 25 element.style.width = "800px"; |
| 26 element.style.height = "600px"; | 26 element.style.height = "600px"; |
| 27 element.style.justifyContent = "start"; |
| 28 element.style.alignContent = "start"; |
| 27 } | 29 } |
| 28 element.style.font = "10px Ahem"; // Used to resolve em font consistently. | 30 element.style.font = "10px Ahem"; // Used to resolve em font consistently. |
| 29 element.style.gridTemplateColumns = columnValue; | 31 element.style.gridTemplateColumns = columnValue; |
| 30 element.style.gridTemplateRows = rowValue; | 32 element.style.gridTemplateRows = rowValue; |
| 31 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-columns')", computedColumnValue || columnValue); | 33 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-columns')", computedColumnValue || columnValue); |
| 32 shouldBeEqualToString("element.style.gridTemplateColumns", jsColumnValue ||
columnValue); | 34 shouldBeEqualToString("element.style.gridTemplateColumns", jsColumnValue ||
columnValue); |
| 33 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-rows')", computedRowValue || rowValue); | 35 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-rows')", computedRowValue || rowValue); |
| 34 shouldBeEqualToString("element.style.gridTemplateRows", jsRowValue || rowVal
ue); | 36 shouldBeEqualToString("element.style.gridTemplateRows", jsRowValue || rowVal
ue); |
| 35 document.body.removeChild(element); | 37 document.body.removeChild(element); |
| 36 } | 38 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 var elementID = element.id || "element"; | 70 var elementID = element.id || "element"; |
| 69 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-auto-rows')", computedRowValue); | 71 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-auto-rows')", computedRowValue); |
| 70 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-auto-columns')", computedColumnValue); | 72 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-auto-columns')", computedColumnValue); |
| 71 } | 73 } |
| 72 | 74 |
| 73 function testGridGapDefinitionsValues(element, computedRowGap, computedColumnGap
) | 75 function testGridGapDefinitionsValues(element, computedRowGap, computedColumnGap
) |
| 74 { | 76 { |
| 75 shouldBeEqualToString("window.getComputedStyle(" + element + ", '').getPrope
rtyValue('grid-row-gap')", computedRowGap); | 77 shouldBeEqualToString("window.getComputedStyle(" + element + ", '').getPrope
rtyValue('grid-row-gap')", computedRowGap); |
| 76 shouldBeEqualToString("window.getComputedStyle(" + element + ", '').getPrope
rtyValue('grid-column-gap')", computedColumnGap); | 78 shouldBeEqualToString("window.getComputedStyle(" + element + ", '').getPrope
rtyValue('grid-column-gap')", computedColumnGap); |
| 77 } | 79 } |
| OLD | NEW |