blob: 8d7f9df5c029595b38ec56d8c7e83fb89dffca92 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
<script>
function imageShapeRect(elementId)
{
var s = document.getElementById("image-shape").getBoundingClientRect();
var r = document.getElementById(elementId).getBoundingClientRect();
return {right: s.right - r.right, top: r.top - s.top, width: r.width, height: r.height};
}
window.onload = function() {
var quiet = true; // PASS output depends on if subpixel layout has been enabled
shouldBe("imageShapeRect('a').top", "0");
shouldBeCloseTo("imageShapeRect('a').right", 292, 1, quiet);
shouldBe("imageShapeRect('b').top", "50");
shouldBe("imageShapeRect('b').right", "300");
shouldBe("imageShapeRect('c').top", "75");
shouldBe("imageShapeRect('c').right", "300");
shouldBe("imageShapeRect('d').top", "125");
shouldBeCloseTo("imageShapeRect('d').right", 292, 1, quiet);
shouldBe("imageShapeRect('e').top", "150");
shouldBe("imageShapeRect('e').right", "0");
};
</script>
<style>
#image-shape {
float: right;
-webkit-shape-outside: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='250px' height='100px'><rect x='50' y='50' width='200' height='50' fill='blue'/></svg>");
-webkit-shape-margin: 50px;
-webkit-shape-image-threshold: 0;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><rect x='0' y='0' width='300' height='150' rx='50' ry='50' fill='blue'/></svg>");
background-repeat: no-repeat;
width: 300px;
height: 250px;
}
#content {
font: 25px/1 Ahem, sans-serif;
color: green;
text-align: right;
}
</style>
</head>
<body>
<p>This test requires the Ahem font. The green content should wrap around the blue rounded rectangle.</p>
<div id="content">
<div id="image-shape"></div>
<span id="a">X</span><br><br><span id="b">X</span><br><span id="c">X</span><br><br><span id="d">X</span><br><span id="e">XXXX</span>
</div>
<div id="console"></div>
</body>
</html>