Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/extensibility/foreignObject/foreign-object-size.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test: auto values for width and height properties on foreignObject compute to zero</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="match" href="foreign-object-size-ref.html">
<style>
div { width: 100px; height: 100px; }
</style>
<svg>
<foreignObject width="100" height="100">
<div style="background-color: green;"></div>
</foreignObject>
<!--
The foreignObject takes its size from its width and height properties.
Unlike HTML elements, a value of auto for these properties (as omitting
the width="" and height="" presentation attributes will do) will compute
to zero, causing it not to be rendered.
-->
<foreignObject>
<div style="background-color: red;"></div>
</foreignObject>
</svg>