available-size-001.html (1673B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Testing Available Space in Orthogonal Flows / max-height / content height</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-001-ref.html"> 7 <meta name="assert" content="When an orthogonal flow's parent doesn't have a definite block size and the nearest ancestor scroller does not have a fixed height but does have a fixed max-height, use that, making sure you stick with the content height."> 8 <style> 9 body > div { 10 font-family: monospace; /* to be able to reliably measure things in ch*/ 11 font-size: 20px; 12 max-height: 8ch; /* **max**-height does not give the element a definite block size */ 13 overflow: hidden; 14 color: transparent; 15 position: relative; /* to act as a container of #red */ 16 padding: 1ch 0; 17 } 18 19 div > div { writing-mode: vertical-rl; } 20 21 span { 22 background: green; 23 display: inline-block; /* This should not change it's size or position, but makes the size of the background predictable*/ 24 } 25 26 #red { /* Not necessary when when comparing to the reference, but makes human judgement easier */ 27 position: absolute; 28 background: red; 29 left: 0; top: 1ch; 30 writing-mode: vertical-rl; 31 z-index: -1; 32 } 33 </style> 34 35 <p>Test passes if there is a <strong>green rectangle</strong> below and <strong>no red</strong>. 36 37 <div> 38 <aside id="red">0</aside> 39 <div>0 0 0 0 <span>0</span> 0 0 0</div> <!-- If this div take its height from 40 the max-height of its parent, it should wrap just right for the green 0 to 41 overlap with the red one. --> 42 </div>