available-size-010.html (2175B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Testing Available Space in Orthogonal Flows / ICB / tall max-height scroller</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 the nearest scroller goes not have a fixed height or max-height, use the ICB, even if there is another scroller ancestor up the chain that does have fixed dimensions."> 8 <style> 9 body { margin-top: 0; margin-bottom: 0; } /* Shouldn't matter, but in some browsers does. -007 tests this aspect specifically. */ 10 :root { overflow: hidden; } 11 div { 12 writing-mode: vertical-rl; 13 font-family: monospace; 14 font-size: 20px; 15 position: relative; /* to be a container for #red*/ 16 } 17 .spacer { /* using 5 spacers of 20vh each instead of a single large one, so 18 that the line would wrap between spacers if it ends up being 19 shorter thatn 100vh*/ 20 display: inline-block; 21 height: calc(20vh - 0.1px); /*Using this instead of 20vh, to account for accumulation of rounding errors, that might make 5*20vh taller than 100vh in some browsers*/ 22 } 23 24 span { 25 background: green; 26 display: inline-block; /* This should not change it's size or position, but makes the size of the background predictable*/ 27 color: transparent; 28 } 29 30 #red { /* Not necessary when when comparing to the reference, but makes human judgement easier */ 31 position: absolute; 32 background: red; 33 writing-mode: vertical-rl; 34 z-index: -1; 35 font-family: monospace; 36 font-size: 20px; 37 left: 0; top: 0; 38 } 39 40 section { overflow: hidden; } 41 body > section { height: 20ch; } 42 </style> 43 44 <p>Test passes if there is a <strong>green rectangle</strong> below and <strong>no red</strong>. 45 46 <section> 47 <section> 48 <section> 49 <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> 50 </section> 51 </section> 52 </section>