4 <script src=
"../../../resources/js-test.js"></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");
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>");
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;
45 font:
25px/
1 Ahem, sans-serif;
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>
56 <div id=
"console"></div>