| OLD | NEW |
| (Empty) | |
| 1 var TestingUtils = (function() { |
| 2 |
| 3 function checkGridTemplateColumns(element, value) { |
| 4 assert_in_array(getComputedStyle(element).gridTemplateColumns, value, "g
ridTemplateColumns"); |
| 5 } |
| 6 |
| 7 function checkGridTemplateRows(element, value) { |
| 8 assert_in_array(getComputedStyle(element).gridTemplateRows, value, "grid
TemplateRows"); |
| 9 } |
| 10 |
| 11 function testGridTemplateColumnsRows(gridId, columnsStyle, rowsStyle, column
sComputedValue, rowsComputedValue) { |
| 12 test(function() { |
| 13 var grid = document.getElementById(gridId); |
| 14 grid.style.gridTemplateColumns = columnsStyle; |
| 15 grid.style.gridTemplateRows = rowsStyle; |
| 16 checkGridTemplateColumns(grid, columnsComputedValue); |
| 17 checkGridTemplateRows(grid, rowsComputedValue); |
| 18 }, "'" + gridId + "' with: grid-template-columns: " + columnsStyle + ";
and grid-template-rows: " + rowsStyle + ";"); |
| 19 } |
| 20 |
| 21 function checkGridTemplateAreas(element, value) { |
| 22 assert_in_array(getComputedStyle(element).gridTemplateAreas, value, "gri
dTemplateAreas"); |
| 23 } |
| 24 |
| 25 function testGridTemplateAreas(gridId, style, value) { |
| 26 test(function() { |
| 27 var grid = document.getElementById(gridId); |
| 28 grid.style.gridTemplateAreas = style; |
| 29 checkGridTemplateAreas(grid, value); |
| 30 }, "'" + gridId + "' with: grid-template-areas: " + style + ";"); |
| 31 } |
| 32 |
| 33 return { |
| 34 testGridTemplateColumnsRows: testGridTemplateColumnsRows, |
| 35 testGridTemplateAreas: testGridTemplateAreas |
| 36 } |
| 37 })(); |
| OLD | NEW |