OLD | NEW |
1 function testGridDefinitionsValues(element, columnValue, rowValue, computedColum
nValue, computedRowValue) | 1 function testGridDefinitionsValues(element, columnValue, rowValue, computedColum
nValue, computedRowValue) |
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')", computedColumnValue || columnValue); | 5 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-columns')", computedColumnValue || columnValue); |
6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-rows')", computedRowValue || rowValue); | 6 shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPro
pertyValue('grid-template-rows')", computedRowValue || 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 { |
(...skipping 17 matching lines...) Expand all Loading... |
28 element.style.font = "10px Ahem"; // Used to resolve em font consistently. | 28 element.style.font = "10px Ahem"; // Used to resolve em font consistently. |
29 element.style.gridTemplateColumns = columnValue; | 29 element.style.gridTemplateColumns = columnValue; |
30 element.style.gridTemplateRows = rowValue; | 30 element.style.gridTemplateRows = rowValue; |
31 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-columns')", computedColumnValue || columnValue); | 31 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-columns')", computedColumnValue || columnValue); |
32 shouldBeEqualToString("element.style.gridTemplateColumns", jsColumnValue ||
columnValue); | 32 shouldBeEqualToString("element.style.gridTemplateColumns", jsColumnValue ||
columnValue); |
33 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-rows')", computedRowValue || rowValue); | 33 shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('grid-
template-rows')", computedRowValue || rowValue); |
34 shouldBeEqualToString("element.style.gridTemplateRows", jsRowValue || rowVal
ue); | 34 shouldBeEqualToString("element.style.gridTemplateRows", jsRowValue || rowVal
ue); |
35 document.body.removeChild(element); | 35 document.body.removeChild(element); |
36 } | 36 } |
37 | 37 |
| 38 function checkGridDefinitionsSetBadJSValues(useGrid, columnValue, rowValue) |
| 39 { |
| 40 window.element = document.createElement("div"); |
| 41 document.body.appendChild(element); |
| 42 if (useGrid) |
| 43 element.style.display = "grid"; |
| 44 element.style.gridTemplateColumns = columnValue; |
| 45 element.style.gridTemplateRows = rowValue; |
| 46 // We can't use testSetJSValues as element.style.gridTemplateRows returns ""
. |
| 47 testGridDefinitionsValues(element, "none", "none"); |
| 48 document.body.removeChild(element); |
| 49 } |
| 50 |
38 function testGridDefinitionsSetBadJSValues(columnValue, rowValue) | 51 function testGridDefinitionsSetBadJSValues(columnValue, rowValue) |
39 { | 52 { |
40 window.element = document.createElement("div"); | 53 checkGridDefinitionsSetBadJSValues(true, columnValue, rowValue); |
41 document.body.appendChild(element); | 54 } |
42 element.style.gridTemplateColumns = columnValue; | 55 |
43 element.style.gridTemplateRows = rowValue; | 56 function testNonGridDefinitionsSetBadJSValues(columnValue, rowValue) |
44 // We can't use testSetJSValues as element.style.gridTemplateRows returns ""
. | 57 { |
45 testGridDefinitionsValues(element, "none", "none"); | 58 checkGridDefinitionsSetBadJSValues(false, columnValue, rowValue); |
46 document.body.removeChild(element); | 59 } |
47 } | |
OLD | NEW |