available-size-007.html (1870B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Testing Available Space in Orthogonal Flows / ICB</title> 4 <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/"> 5 <link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#orthogonal-auto"> 6 <link rel="match" href="reference/available-size-002-ref.html"> 7 <meta name="assert" content="When an orthogonal flow's parent doesn't have a definite block size, and there's no scroller among ancestors, use the ICB instead (not the content height of the body element, which is the ICB reduced by body's margins)."> 8 <style> 9 div { 10 writing-mode: vertical-rl; 11 font-family: monospace; 12 font-size: 20px; 13 position: relative; /* to be a container for #red*/ 14 } 15 :root { overflow: hidden; } 16 .spacer { /* using 5 spacers of 20vh each instead of a single large one, so 17 that the line would wrap between spacers if it ends up being 18 shorter thatn 100vh*/ 19 display: inline-block; 20 height: calc(20vh - 0.1px); /*Using this instead of 20vh, to account for accumulation of rounding errors, that might make 5*20 taller than 100vh in some browsers*/ 21 } 22 23 span { 24 background: green; 25 display: inline-block; /* This should not change it's size or position, but makes the size of the background predictable*/ 26 color: transparent; 27 } 28 29 #red { /* Not necessary when when comparing to the reference, but makes human judgement easier */ 30 position: absolute; 31 background: red; 32 writing-mode: vertical-rl; 33 z-index: -1; 34 font-family: monospace; 35 font-size: 20px; 36 left: 0; top: 0; 37 } 38 39 </style> 40 41 <p>Test passes if there is a <strong>green rectangle</strong> below and <strong>no red</strong>. 42 43 <div><aside id="red">0</aside><aside class="spacer"></aside><aside class="spacer"></aside><aside class="spacer"></aside><aside class="spacer"></aside><aside class="spacer"></aside> <span>0</span></div>