grid-positioned-items-unknown-named-grid-line-001.html (2593B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Grid positioned items unknown named grid line</title> 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid-1/#abspos" title="9. Absolute Positioning"> 6 <meta name="assert" content="This test checks that grid placement properties of absolutely positioned items can reference implicit grid lines."> 7 <link rel="stylesheet" href="/fonts/ahem.css"> 8 <link rel="stylesheet" href="/css/support/grid.css"> 9 <style> 10 11 .grid { 12 grid-template-columns: 100px 200px; 13 grid-template-rows: 50px 150px; 14 width: 500px; 15 height: 300px; 16 border: 5px solid black; 17 margin: 30px; 18 padding: 15px; 19 /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */ 20 position: relative; 21 } 22 23 .absolute { 24 position: absolute; 25 } 26 27 .startUnknownLine { 28 background-color: blue; 29 grid-column: foo / 3; 30 grid-row: bar / 3; 31 } 32 33 .endUnknownLine { 34 background-color: orange; 35 grid-column: 1 / foo; 36 grid-row: 1 / bar; 37 } 38 39 .startAndEndUnknownLines { 40 background-color: green; 41 grid-column: foo / bar; 42 grid-row: foo / bar; 43 } 44 45 </style> 46 <script src="/resources/testharness.js"></script> 47 <script src="/resources/testharnessreport.js"></script> 48 <script src="/resources/check-layout-th.js"></script> 49 <script type="text/javascript"> 50 setup({ explicit_done: true }); 51 </script> 52 53 <body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })"> 54 55 <div id="log"></div> 56 57 <div class="grid"> 58 <div class="absolute sizedToGridArea startAndEndUnknownLines" 59 data-offset-x="0" data-offset-y="0" data-expected-width="530" data-expected-height="330"> 60 </div> 61 <div class="absolute sizedToGridArea endUnknownLine" 62 data-offset-x="15" data-offset-y="15" data-expected-width="515" data-expected-height="315"> 63 </div> 64 <div class="absolute sizedToGridArea startUnknownLine" 65 data-offset-x="315" data-offset-y="215" data-expected-width="215" data-expected-height="115"> 66 </div> 67 </div> 68 69 <div class="grid directionRTL"> 70 <div class="absolute sizedToGridArea startAndEndUnknownLines" 71 data-offset-x="0" data-offset-y="0" data-expected-width="530" data-expected-height="330"> 72 </div> 73 <div class="absolute sizedToGridArea endUnknownLine" 74 data-offset-x="0" data-offset-y="15" data-expected-width="515" data-expected-height="315"> 75 </div> 76 <div class="absolute sizedToGridArea startUnknownLine" 77 data-offset-x="0" data-offset-y="215" data-expected-width="215" data-expected-height="115"> 78 </div> 79 </div> 80 81 </body>