svg-intrinsic-size-006.html (1146B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Test: Test SVG intrinsic sizing with and without preferred aspect-ratio</title> 4 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 5 <link rel="author" title="Mozilla" href="https://mozilla.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes"> 7 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1801581"> 8 <link rel="match" href="svg-intrinsic-size-006-ref.html"> 9 10 <style> 11 div { 12 width: max-content; 13 background: green; 14 line-height: 0; 15 border: 5px solid black; 16 margin: 5px; 17 } 18 svg { 19 vertical-align: top; 20 } 21 </style> 22 23 <!-- Chrome 110 and Safari 16.4 render these two divs with zero width. --> 24 <div><svg viewBox="0 0 1 1"></svg></div> 25 <div><svg style="aspect-ratio: 1/1;"></svg></div> 26 27 <!-- Chrome 110 and Safari 16.4 render the following divs with 300px width. --> 28 <div><svg></svg></div> 29 <div><svg style="width: 10%" viewBox="0 0 1 1"></svg></div> 30 <div><svg width="10%" viewBox="0 0 1 1"></svg></div> 31 <div><svg style="width: 10%; aspect-ratio: 1/1"></svg></div> 32 <div><svg width="10%" style="aspect-ratio: 1/1"></svg></div>