dynamic-baseline-change-nested.html (997B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#baseline-participation"> 3 <link rel="match" href="dynamic-baseline-change-ref.html"> 4 <meta name="assert" content="This test ensures proper baseline alignment for a sub-tree which adds a scrollbar."> 5 <div style="display: flex; width: 100px; border: solid; align-items: baseline;"> 6 <div style="width: 50px; height: 50px;"> 7 <div style="width: 50px; height: 50px; position: relative; overflow: auto;"> 8 <canvas width=10 height=10 style="width: 80%; background: green;"></canvas> <!-- Baseline of the canvas will move when a scrollbar is added. --> 9 <div id="target" style="position: absolute; width: 10px; height: 10px; background: red; top: 0;"></div> 10 </div> 11 </div> 12 <div style="width: 50px; height: 50px; background: green;"></div> <!-- Baseline is synthesized at the block-end edge. --> 13 </div> 14 <script> 15 document.body.offsetTop; 16 document.getElementById('target').style.top = '100px'; 17 </script>