blob: fd528d34947fe2f4480e2c7771e76a913c3c013e [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Auto Width for Replaced Element with Intrinsic Ratio Only</title>
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width">
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
<link rel="help" href="http://www.w3.org/TR/SVGTiny12/coords.html#IntrinsicSizing">
<meta name="flags" content="may svg">
<style type="text/css">
body { width: 15em; border: 1px silver dashed; }
table, td { border-spacing: 0; border-collapse: collapse; padding: 0; }
p, table { margin: 6em 0; height: 1em; line-height: 1em;}
/* basic tests for inline and block */
#img1 { margin-top: -1em; }
#img2 { display: block; }
/* shrinkwrapped */
#p3 { width: 100%; float: left; margin: 0; }
#t4 { width: 15em; display: table-cell; }
#t5 { width: 100%; }
/* controls */
object { background: red; }
object, .control { border: 1em blue solid; margin: 0 1em; }
.control { background: green; }
.inst { height: auto; margin: 1em 0; }
</style>
</head>
<body onload="runAfterLayoutAndPaint(repaintTest, true);">
<p class="inst">The following six blue boxes must be of the same width. There must be no red.</p>
<p class="control">&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!-- sizing is against containing block, not available space -->
<object id="img1" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p>
<p><object id="img2" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p>
<p id="t4"><object id="img4" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p>
<table id="t5"><tr><td><object id="img5" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></td></tr></table>
<p id="p3"><object id="img3" type="image/svg+xml" data="resources/intrinsic-ratio.svg">This test won't work because you do not have images enabled.</object></p>
<script>var zoomCount = 3; window.shouldZoomOut = true;</script>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script src="../resources/testPageZoom.js"></script>
<script>
// There are some invisible pixel changes which exceed the threshold of our
// raster-under-invalidation checking, but seems acceptable.
if (window.internals)
internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false;
</script>
</body>
</html>