Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>Zero viewBox disables rendering in inline, nested and SVG-as-image contexts</title>
<link rel="match" href="viewBox-zero-disables-rendering-contexts-ref.html">
<meta name="assert" content="A zero-width viewBox disables rendering of the element in every context: an inline outer svg, a nested inner svg, and an svg referenced as an image.">
<body style="margin:0">
<!-- inline outer svg -->
<svg width="100" height="100" viewBox="0 0 0 100"><rect width="100" height="100" fill="green"/></svg>
<!-- nested inner svg carries the zero viewBox -->
<svg width="100" height="100"><svg width="100" height="100" viewBox="0 0 0 100"><rect width="100" height="100" fill="green"/></svg></svg>
<!-- svg referenced as an image (secure static mode) -->
</body>