blob: 98f73cefeb0f317766c16e033b61871bf1dc89e3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
grid-columns: 100px 300px;
grid-rows: 50px 150px;
height: 200px;
width: 400px;
}
.calcWidth {
width: -webkit-calc(80% + 20%);
height: 15px;
}
.calcHeight {
width: 15px;
height: -webkit-calc(80% + 20px);
}
.calcHeightAndWidth {
width: -webkit-calc(80% + 20px);
height: -webkit-calc(70% + 30%);
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid')">
<p>Test that resolving calc lengths on grid items works properly on a fixed grid with different writing modes.</p>
<div class="grid">
<div class="firstRowFirstColumn calcWidth" data-expected-width="100" data-expected-height="15"></div>
<div class="firstRowSecondColumn calcHeight" data-expected-width="15" data-expected-height="60"></div>
<div class="secondRowFirstColumn calcHeightAndWidth" data-expected-width="100" data-expected-height="150"></div>
<div class="secondRowSecondColumn calcHeightAndWidth" data-expected-width="260" data-expected-height="150"></div>
</div>
<div class="grid verticalRL">
<div class="firstRowFirstColumn calcWidth" data-expected-width="50" data-expected-height="15"></div>
<div class="firstRowSecondColumn calcHeight" data-expected-width="15" data-expected-height="260"></div>
<div class="secondRowFirstColumn calcHeightAndWidth" data-expected-width="140" data-expected-height="100"></div>
<div class="secondRowSecondColumn calcHeightAndWidth" data-expected-width="140" data-expected-height="300"></div>
</div>
<div class="grid">
<div class="firstRowFirstColumn calcWidth verticalRL" data-expected-width="100" data-expected-height="15"></div>
<div class="firstRowSecondColumn calcHeight verticalRL" data-expected-width="15" data-expected-height="60"></div>
<div class="secondRowFirstColumn calcHeightAndWidth verticalRL" data-expected-width="100" data-expected-height="150"></div>
<div class="secondRowSecondColumn calcHeightAndWidth verticalRL" data-expected-width="260" data-expected-height="150"></div>
</div>
<div class="grid">
<div class="firstRowFirstColumn calcWidth verticalRL" data-expected-width="100" data-expected-height="15"></div>
<div class="firstRowSecondColumn calcHeight" data-expected-width="15" data-expected-height="60"></div>
<div class="secondRowFirstColumn calcHeightAndWidth verticalRL" data-expected-width="100" data-expected-height="150"></div>
<div class="secondRowSecondColumn calcHeightAndWidth" data-expected-width="260" data-expected-height="150"></div>
</div>
</body>
</html>