Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-flexbox/svg-root-as-flex-item-006.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>SVG root as flex item</title>
<link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org">
<meta name="assert"
content="When SVG has aspect ratio and no intrinsic height its flex-basis is available width * ratio, not 150px, when in a column flexbox." />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
The test passes if you see a 600x300 blue rectangle.
<div style="display: flex; flex-direction: column; width: 600px;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" data-expected-bounding-client-rect-width=600
data-expected-bounding-client-rect-height=300>
<rect x="0" y="0" width="200" height="100" fill="blue" />
</svg>
</div>
<script>
checkLayout('svg');
</script>