Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / shapes / shape-outside-floats / shape-outside-floats-image-margin-001.html
blobfa1374203de7451d6814ab8a92b3648f3b109986
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 function imageShapeRect(elementId)
8 var s = document.getElementById("image-shape").getBoundingClientRect();
9 var r = document.getElementById(elementId).getBoundingClientRect();
10 return {left: r.left - s.left, top: r.top - s.top, width: r.width, height: r.height};
13 window.onload = function() {
14 var quiet = true; // PASS output depends on if subpixel layout has been enabled
16 shouldBe("imageShapeRect('a').top", "0");
17 shouldBeCloseTo("imageShapeRect('a').left", 292, 1, quiet);
19 shouldBe("imageShapeRect('b').top", "50");
20 shouldBe("imageShapeRect('b').left", "300");
22 shouldBe("imageShapeRect('c').top", "75");
23 shouldBe("imageShapeRect('c').left", "300");
25 shouldBe("imageShapeRect('d').top", "125");
26 shouldBeCloseTo("imageShapeRect('d').left", 292, 1, quiet);
28 shouldBe("imageShapeRect('e').top", "150");
29 shouldBe("imageShapeRect('e').left", "0");
31 </script>
32 <style>
33 #image-shape {
34 float: left;
35 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>");
36 shape-margin: 50px;
37 shape-image-threshold: 0;
38 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>");
39 background-repeat: no-repeat;
40 width: 350px;
41 height: 250px;
44 #content {
45 font: 25px/1 Ahem, sans-serif;
46 color: green;
48 </style>
49 </head>
50 <body>
51 <p>This test requires the Ahem font. The green content should wrap around the blue rounded rectangle.</p>
52 <div id="content" style="position: relative">
53 <div id="image-shape"></div>
54 <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>
55 </div>
56 <div id="console"></div>
57 </body>
58 </html>