blob: 0af1ee7bf65768e251c1c7f23f6d370cbdb0f1ed [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: 50px 100px 200px;
grid-rows: 50px 100px 200px;
background-color: #aaa;
}
.grid > * {
grid-column: 2;
grid-row: 3;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid > *')">
<p>This test checks that the grid items' 'display' computed value matches the specification. It also checks that the grid items are placed in the right grid area.</p>
<div style="position: relative;">
<div class="grid">
<!-- These values are taken from the table in CSS 2.1 Chapter 9.7. -->
<div data-expected-display="table" data-offset-x="50" data-offset-y="150" style="display: inline-table"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: inline"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-row-group"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-column"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-column-group"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-header-group"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-footer-group"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-row"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-cell"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: table-caption"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: inline-block"></div>
<!-- Some extra values we support. -->
<div data-expected-display="-webkit-flex" data-offset-x="50" data-offset-y="150" style="display: -webkit-flex"></div>
<div data-expected-display="-webkit-flex" data-offset-x="50" data-offset-y="150" style="display: -webkit-inline-flex"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: -webkit-inline-block"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: compact"></div>
<div data-expected-display="block" data-offset-x="50" data-offset-y="150" style="display: run-in"></div>
<!-- Elements with custom renderers. -->
<button data-expected-display="block" data-offset-x="50" data-offset-y="150"></button>
<canvas data-expected-display="block" data-offset-x="50" data-offset-y="150">canvas</canvas>
<iframe data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
<iframe seamless data-expected-display="block" data-offset-x="50" data-offset-y="150" src="data:text/html,<body bgcolor=#fff>iframe</body>"></iframe>
<object data-expected-display="block" data-offset-x="50" data-offset-y="150">object</object>
<select data-expected-display="block" data-offset-x="50" data-offset-y="150">
<option>select</option>
</select>
<textarea data-expected-display="block" data-offset-x="50" data-offset-y="150">textarea</textarea>
<input data-expected-display="block" data-offset-x="50" data-offset-y="150" type="checkbox" value="radio"></input>
<input data-expected-display="block" data-offset-x="50" data-offset-y="150" type="file" value="file"></input>
<input data-expected-display="block" data-offset-x="50" data-offset-y="150" type="image" value="image"></input>
<input data-expected-display="block" data-offset-x="50" data-offset-y="150" type="password" value="image"></input>
<input data-expected-display="block" data-offset-x="50" data-offset-y="150" type="text" value="text"></input>
<img data-expected-display="block" data-offset-x="50" data-offset-y="150" src="../images/resources/green-256x256.png"></img>
<img data-expected-display="block" data-offset-x="50" data-offset-y="150" src="nonexistent.png"></img>
<svg data-expected-display="block" data-offset-x="50" data-offset-y="150">
<circle cx="50" cy="50" r="50" fill="blue">
</circle>
</svg>
<!-- Spans are common so they should be tested. -->
<span data-expected-display="block" data-offset-x="50" data-offset-y="150"></span>
</div>
</div>
</html>