blob: db000916e6c2ec74c5805bdee282708efe6173a2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<link href="resources/grid.css" rel="stylesheet"/>
<style>
.gridFixedMinContentAndFixedMaxContent {
-webkit-grid-template-columns: minmax(20px, -webkit-min-content) minmax(20px, -webkit-max-content);
}
.gridMaxContentFixedAndMinContentFixed {
-webkit-grid-template-columns: minmax(-webkit-max-content, 50px) minmax(-webkit-min-content, 50px);
}
.gridFixedMinContentAndAuto {
-webkit-grid-template-columns: minmax(20px, -webkit-min-content) auto;
}
.gridFixedMaxContentAndAuto {
-webkit-grid-template-columns: minmax(20px, -webkit-max-content) auto;
}
.gridMaxContentAndAuto {
-webkit-grid-template-columns: -webkit-max-content auto;
}
.gridAutoAndMaxContent {
-webkit-grid-template-columns: auto -webkit-max-content;
}
.gridMinContentAndAuto {
-webkit-grid-template-columns: -webkit-min-content auto;
}
.gridAutoAndMinContent {
-webkit-grid-template-columns: -webkit-min-content auto;
}
.spanTwo {
-webkit-grid-column: 1 / 3;
}
</style>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div style="position: relative">
<div id="gridFixedMinContentAndFixedMaxContent" class="grid gridFixedMinContentAndFixedMaxContent">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridMaxContentFixedAndMinContentFixed" class="grid gridMaxContentFixedAndMinContentFixed">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridFixedMinContentAndAuto" class="grid gridFixedMinContentAndAuto">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridFixedMaxContentAndAuto" class="grid gridFixedMaxContentAndAuto">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridMaxContentAndAuto" class="grid gridMaxContentAndAuto">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridAutoAndMaxContent" class="grid gridAutoAndMaxContent">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridMinContentAndAuto" class="grid gridMinContentAndAuto">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
<div style="position: relative">
<div id="gridAutoAndMinContent" class="grid gridAutoAndMinContent">
<div class="firstRowFirstColumn">XXXXX</div>
<div class="spanTwo secondRowFirstColumn">XXX XXX</div>
</div>
</div>
</body>
<script src="resources/grid-definitions-parsing-utils.js"></script>
<script>
function checkTrackBreadthAfterItemRowSwap(gridId)
{
window.gridElement = document.getElementById(gridId);
var oldValue = getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-template-columns');
var firstChildRow = getComputedStyle(gridElement.children[0],'').getPropertyValue('-webkit-grid-row');
gridElement.children[0].style.webkitGridRow = getComputedStyle(gridElement.children[1],'').getPropertyValue('-webkit-grid-row');
gridElement.children[1].style.webkitGridRow = firstChildRow;
var newValue = getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-template-columns');
if (newValue == oldValue)
testPassed("grid-template-columns is " + newValue + " after grid row swap.");
else
testFailed("grid-template-columns should be " + oldValue + ". Was " + newValue + ".");
}
checkTrackBreadthAfterItemRowSwap("gridFixedMinContentAndFixedMaxContent");
checkTrackBreadthAfterItemRowSwap("gridMaxContentFixedAndMinContentFixed");
checkTrackBreadthAfterItemRowSwap("gridFixedMinContentAndAuto");
checkTrackBreadthAfterItemRowSwap("gridFixedMaxContentAndAuto");
checkTrackBreadthAfterItemRowSwap("gridMaxContentAndAuto");
checkTrackBreadthAfterItemRowSwap("gridAutoAndMaxContent");
checkTrackBreadthAfterItemRowSwap("gridMinContentAndAuto");
checkTrackBreadthAfterItemRowSwap("gridAutoAndMinContent");
</script>
</html>