3 <link href=
"resources/grid.css" rel=
"stylesheet">
6 grid-template-columns:
50px
100px;
7 grid-template-rows:
70px
140px;
20 <script src=
"../../resources/check-layout.js"></script>
22 function testLayout(gridElementID
, gridTracks
, size
)
24 var gridElement
= document
.getElementById(gridElementID
);
25 gridElement
.style
.gridTemplateRows
= gridTracks
.rows
;
26 var gridItem
= gridElement
.firstChild
.nextSibling
;
27 gridItem
.setAttribute("data-expected-width", size
.width
);
28 gridItem
.setAttribute("data-expected-height", size
.height
);
29 checkLayout("#" + gridElementID
, document
.getElementById("test-output"))
34 testLayout("gridWithMinHeightItem", { "rows": "70px 140px" }, { "width": "50", "height": "35" });
35 testLayout("gridWithMinHeightItem", { "rows": "100px 140px" }, { "width": "50", "height": "50" });
36 testLayout("gridWithMinHeightItem", { "rows": "100px 240px" }, { "width": "50", "height": "50" });
37 testLayout("gridWithMinHeightItem", { "rows": "10px 240px" }, { "width": "50", "height": "10" });
39 testLayout("gridWithMaxHeightItem", { "rows": "70px 140px" }, { "width": "50", "height": "35" });
40 testLayout("gridWithMaxHeightItem", { "rows": "100px 140px" }, { "width": "50", "height": "50" });
41 testLayout("gridWithMaxHeightItem", { "rows": "100px 240px" }, { "width": "50", "height": "50" });
42 testLayout("gridWithMaxHeightItem", { "rows": "1000px 240px" }, { "width": "50", "height": "100" });
45 window
.addEventListener("load", runTests
, false);
49 <p>Test that grid items with a percentage logical min-height or max-height resolve their size properly.
</p>
51 <div id=
"gridWithMinHeightItem" class=
"grid">
52 <div id=
"minHeightPercent"></div>
55 <div id=
"gridWithMaxHeightItem" class=
"grid">
56 <div id=
"maxHeightPercent"></div>
59 <div id=
"test-output"></div>