|
Line 0
a/LayoutTests/fast/css-grid-layout/flex-and-content-sized-resolution-columns.html_sec1
|
|
|
1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<link href="resources/grid.css" rel="stylesheet"> |
| 5 |
<style> |
| 6 |
.grid { |
| 7 |
font: 10px/1 Ahem; |
| 8 |
} |
| 9 |
|
| 10 |
.gridFixedAndMinContentAndFlex { |
| 11 |
-webkit-grid-template-columns: 20px -webkit-min-content 1fr; |
| 12 |
} |
| 13 |
|
| 14 |
.gridMinMaxFixedFlexAndMaxContentAndAuto { |
| 15 |
-webkit-grid-template-columns: minmax(20px, 1fr) -webkit-max-content auto; |
| 16 |
} |
| 17 |
|
| 18 |
.gridMinMaxFlexFixedAndMinContentAndFixed { |
| 19 |
-webkit-grid-template-columns: minmax(0.5fr, 35px) -webkit-min-content 25px; |
| 20 |
} |
| 21 |
|
| 22 |
.gridMinContentAndMinMaxFixedMinContentAndFlex { |
| 23 |
-webkit-grid-template-columns: -webkit-min-content minmax(20px, -webkit-min-content) 2fr; |
| 24 |
} |
| 25 |
|
| 26 |
.gridMaxContentAndMinMaxFixedMaxContentAndFlex { |
| 27 |
-webkit-grid-template-columns: -webkit-max-content minmax(20px, -webkit-max-content) 1fr; |
| 28 |
} |
| 29 |
|
| 30 |
</style> |
| 31 |
<script src="../../resources/js-test.js"></script> |
| 32 |
</head> |
| 33 |
<body> |
| 34 |
|
| 35 |
<p>Test that resolving auto tracks on grid items works properly.</p> |
| 36 |
|
| 37 |
<div style="position: relative; width: 100px;"> |
| 38 |
<div id="gridFixedAndMinContentAndFlex" class="grid gridFixedAndMinContentAndFlex"> |
| 39 |
<div style="-webkit-grid-column: 2 / span 2;">XXXXXXXX</div> |
| 40 |
<div style="-webkit-grid-column: 1 / span 2; -webkit-grid-row: 2;">XXXXX</div> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
|
| 44 |
<div style="position: relative; width: 100px;"> |
| 45 |
<div id="gridFixedAndMinContentAndFlexMultipleOverlap" class="grid gridFixedAndMinContentAndFlex"> |
| 46 |
<div style="-webkit-grid-column: 1 / span 2;">XXX XXX</div> |
| 47 |
<div style="-webkit-grid-column: 1 / -1; -webkit-grid-row: 2;">XXXX</div> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
|
| 51 |
<div style="position: relative; width: 100px;"> |
| 52 |
<div id="gridMinMaxFixedFlexAndMaxContentAndAuto" class="grid gridMinMaxFixedFlexAndMaxContentAndAuto"> |
| 53 |
<div style="-webkit-grid-column: 1 / span 2;">XXX XXX</div> |
| 54 |
<div style="-webkit-grid-column: 2 / span 2; -webkit-grid-row: 2;">XXXX</div> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
|
| 58 |
<div style="position: relative; width: 100px;"> |
| 59 |
<div id="gridMinMaxFixedFlexAndMaxContentAndAutoNoFlexSpanningItems" class="grid gridMinMaxFixedFlexAndMaxContentAndAuto"> |
| 60 |
<div style="-webkit-grid-column: 1 / -1;">XXX XXX</div> |
| 61 |
<div style="-webkit-grid-column: 1 / span 2; -webkit-grid-row: 2;">XXXX XXXX</div> |
| 62 |
</div> |
| 63 |
</div> |
| 64 |
|
| 65 |
<div style="position: relative; width: 100px;"> |
| 66 |
<div id="gridMinMaxFlexFixedAndMinContentAndFixed" class="grid gridMinMaxFlexFixedAndMinContentAndFixed"> |
| 67 |
<div style="-webkit-grid-column: 1 / span 2;">XXXX XXXX</div> |
| 68 |
<div style="-webkit-grid-column: 2 / span 2; -webkit-grid-row: 2;">XXX XXX</div> |
| 69 |
<div style="-webkit-grid-column: 1 / -1; -webkit-grid-row: 3;">XXXXX XXXXX</div> |
| 70 |
<div style="-webkit-grid-column: 2 / span 2; -webkit-grid-row: 4;">XX XX XX XX</div> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
|
| 74 |
<div style="position: relative; width: 100px;"> |
| 75 |
<div id="gridMinContentAndMinMaxFixedMinContentAndFlex" class="grid gridMinContentAndMinMaxFixedMinContentAndFlex"> |
| 76 |
<div style="-webkit-grid-column: 2 / span 2;">XXXXX</div> |
| 77 |
<div style="-webkit-grid-column: 1 / -1; -webkit-grid-row: 2;">XXX XXX XXX</div> |
| 78 |
<div style="-webkit-grid-column: 1 / span 2; -webkit-grid-row: 3;">XXXX XXXX</div> |
| 79 |
</div> |
| 80 |
</div> |
| 81 |
|
| 82 |
<div style="position: relative; width: 100px;"> |
| 83 |
<div id="gridMaxContentAndMinMaxFixedMaxContentAndFlex" class="grid gridMaxContentAndMinMaxFixedMaxContentAndFlex"> |
| 84 |
<div style="-webkit-grid-column: 2 / span 2;">XXXXX</div> |
| 85 |
<div style="-webkit-grid-column: 1 / -1; -webkit-grid-row: 2;">XXX XXX XXX</div> |
| 86 |
<div style="-webkit-grid-column: 1 / span 2; -webkit-grid-row: 3;">XXXX XXXX</div> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
|
| 90 |
</body> |
| 91 |
<script src="resources/grid-definitions-parsing-utils.js"></script> |
| 92 |
<script> |
| 93 |
function checkColumns(gridId, columnValue) |
| 94 |
{ |
| 95 |
window.gridElement = document.getElementById(gridId); |
| 96 |
shouldBeEqualToString("window.getComputedStyle(" + gridId + ", '').getPropertyValue('-webkit-grid-template-columns')", columnValue); |
| 97 |
} |
| 98 |
|
| 99 |
checkColumns("gridFixedAndMinContentAndFlex", "20px 30px 50px"); |
| 100 |
checkColumns("gridFixedAndMinContentAndFlexMultipleOverlap", "20px 10px 70px"); |
| 101 |
checkColumns("gridMinMaxFixedFlexAndMaxContentAndAuto", "60px 20px 20px"); |
| 102 |
checkColumns("gridMinMaxFixedFlexAndMaxContentAndAutoNoFlexSpanningItems", "100px 0px 0px"); |
| 103 |
checkColumns("gridMinMaxFlexFixedAndMinContentAndFixed", "35px 5px 25px"); |
| 104 |
checkColumns("gridMinContentAndMinMaxFixedMinContentAndFlex", "20px 20px 60px"); |
| 105 |
checkColumns("gridMaxContentAndMinMaxFixedMaxContentAndFlex", "70px 20px 10px"); |
| 106 |
|
| 107 |
</script> |
| 108 |
</html> |