OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <link href="resources/grid.css" rel="stylesheet"> | 3 <link href="resources/grid.css" rel="stylesheet"> |
4 <style> | 4 <style> |
5 .grid { | 5 .grid { |
6 grid-template-columns: 50px 100px; | 6 grid-template-columns: 50px 100px; |
7 grid-template-rows: 70px 140px; | 7 grid-template-rows: 70px 140px; |
8 } | 8 } |
9 | 9 |
10 #minHeightPercent { | 10 #minHeightPercent { |
(...skipping 13 matching lines...) Expand all Loading... |
24 var gridElement = document.getElementById(gridElementID); | 24 var gridElement = document.getElementById(gridElementID); |
25 gridElement.style.gridTemplateRows = gridTracks.rows; | 25 gridElement.style.gridTemplateRows = gridTracks.rows; |
26 var gridItem = gridElement.firstChild.nextSibling; | 26 var gridItem = gridElement.firstChild.nextSibling; |
27 gridItem.setAttribute("data-expected-width", size.width); | 27 gridItem.setAttribute("data-expected-width", size.width); |
28 gridItem.setAttribute("data-expected-height", size.height); | 28 gridItem.setAttribute("data-expected-height", size.height); |
29 checkLayout("#" + gridElementID, document.getElementById("test-output")) | 29 checkLayout("#" + gridElementID, document.getElementById("test-output")) |
30 } | 30 } |
31 | 31 |
32 function runTests() | 32 function runTests() |
33 { | 33 { |
34 testLayout("gridWithMinHeightItem", { "rows": "70px 140px" }, { "width": "50
px", "height": "35px" }); | 34 testLayout("gridWithMinHeightItem", { "rows": "70px 140px" }, { "width": "50
", "height": "35" }); |
35 testLayout("gridWithMinHeightItem", { "rows": "100px 140px" }, { "width": "5
0px", "height": "50px" }); | 35 testLayout("gridWithMinHeightItem", { "rows": "100px 140px" }, { "width": "5
0", "height": "50" }); |
36 testLayout("gridWithMinHeightItem", { "rows": "100px 240px" }, { "width": "5
0px", "height": "50px" }); | 36 testLayout("gridWithMinHeightItem", { "rows": "100px 240px" }, { "width": "5
0", "height": "50" }); |
37 testLayout("gridWithMinHeightItem", { "rows": "10px 240px" }, { "width": "50
px", "height": "10px" }); | 37 testLayout("gridWithMinHeightItem", { "rows": "10px 240px" }, { "width": "50
", "height": "10" }); |
38 | 38 |
39 testLayout("gridWithMaxHeightItem", { "rows": "70px 140px" }, { "width": "50
px", "height": "35px" }); | 39 testLayout("gridWithMaxHeightItem", { "rows": "70px 140px" }, { "width": "50
", "height": "35" }); |
40 testLayout("gridWithMaxHeightItem", { "rows": "100px 140px" }, { "width": "5
0px", "height": "50px" }); | 40 testLayout("gridWithMaxHeightItem", { "rows": "100px 140px" }, { "width": "5
0", "height": "50" }); |
41 testLayout("gridWithMaxHeightItem", { "rows": "100px 240px" }, { "width": "5
0px", "height": "50px" }); | 41 testLayout("gridWithMaxHeightItem", { "rows": "100px 240px" }, { "width": "5
0", "height": "50" }); |
42 testLayout("gridWithMaxHeightItem", { "rows": "1000px 240px" }, { "width": "
50px", "height": "100px" }); | 42 testLayout("gridWithMaxHeightItem", { "rows": "1000px 240px" }, { "width": "
50", "height": "100" }); |
43 } | 43 } |
44 | 44 |
45 window.addEventListener("load", runTests, false); | 45 window.addEventListener("load", runTests, false); |
46 </script> | 46 </script> |
47 <body> | 47 <body> |
48 | 48 |
49 <p>Test that grid items with a percentage logical min-height or max-height resol
ve their size properly.</p> | 49 <p>Test that grid items with a percentage logical min-height or max-height resol
ve their size properly.</p> |
50 | 50 |
51 <div id="gridWithMinHeightItem" class="grid"> | 51 <div id="gridWithMinHeightItem" class="grid"> |
52 <div id="minHeightPercent"></div> | 52 <div id="minHeightPercent"></div> |
53 </div> | 53 </div> |
54 | 54 |
55 <div id="gridWithMaxHeightItem" class="grid"> | 55 <div id="gridWithMaxHeightItem" class="grid"> |
56 <div id="maxHeightPercent"></div> | 56 <div id="maxHeightPercent"></div> |
57 </div> | 57 </div> |
58 | 58 |
59 <div id="test-output"></div> | 59 <div id="test-output"></div> |
60 | 60 |
61 </body> | 61 </body> |
62 </html> | 62 </html> |
OLD | NEW |