2 <script src=
"../../../resources/testharness.js"></script>
3 <script src=
"../../../resources/testharnessreport.js"></script>
4 <script src=
"../resources/subpixel-utils.js"></script>
7 font:
10px/
1 Ahem, sans-serif;
10 border:
1px solid black;
11 -webkit-writing-mode: vertical-lr;
16 -webkit-writing-mode: horizontal-tb;
19 background-color: blue;
20 border-radius:
50px
40px
30px
20px /
20px
30px
40px
50px;
21 shape-outside: inset(
0px round
50px
40px
30px
20px /
20px
30px
40px
50px);
26 <p>The block squares should wrap around the bottom of the blue shape. They should not overlap the shape.
</p>
28 <span id=
"s1">X
</span><br/>
29 <div id=
"rounded-rect"></div>
30 <span id=
"s2">X
</span><br/>
31 <span id=
"s3">X
</span><br/>
32 <span id=
"s4">X
</span><br/>
33 <span id=
"s5">X
</span><br/>
34 <span id=
"s6">X
</span><br/>
35 <span id=
"s7">X
</span><br/>
36 <span id=
"s8">X
</span><br/>
37 <span id=
"s9">X
</span><br/>
38 <span id=
"s10">X
</span><br/>
39 <span id=
"s11">X
</span><br/>
40 <span id=
"s12">X
</span>
45 function elementRect(elementId
)
47 var s
= document
.getElementById("container").getBoundingClientRect();
48 var r
= document
.getElementById(elementId
).getBoundingClientRect();
49 return {left
: r
.left
- s
.left
, top
: r
.top
- s
.top
, width
: r
.width
, height
: r
.height
};
53 var rect
= elementRect("s1");
54 assert_equals(rect
.left
, 1);
55 assert_equals(rect
.top
, 1);
56 }, "1st square doesn't overlap shape.");
59 var rect
= elementRect("s2");
60 assert_equals(rect
.left
, 11);
61 assert_approx_equals(rect
.top
, 91, 0.5);
62 }, "2nd square is properly affected by shape.");
65 var rect
= elementRect("s3");
66 assert_equals(rect
.left
, 21);
67 assert_approx_equals(rect
.top
, 97, 0.5);
68 }, "3rd square is properly affected by shape.");
71 var rect
= elementRect("s4");
72 assert_equals(rect
.left
, 31);
73 assert_approx_equals(rect
.top
, 100, 0.5);
74 }, "4th square is properly affected by shape.");
77 var rect
= elementRect("s5");
78 assert_equals(rect
.left
, 41);
79 assert_approx_equals(rect
.top
, 101, 0.5);
80 }, "5th square is properly affected by shape.");
83 var rect
= elementRect("s6");
84 assert_equals(rect
.left
, 51);
85 assert_approx_equals(rect
.top
, 101, 0.5);
86 }, "6th square is properly affected by shape.");
89 var rect
= elementRect("s7");
90 assert_equals(rect
.left
, 61);
91 assert_approx_equals(rect
.top
, 101, 0.5);
92 }, "7th square is properly affected by shape.");
95 var rect
= elementRect("s8");
96 assert_equals(rect
.left
, 71);
97 assert_approx_equals(rect
.top
, 101, 0.5);
98 }, "8th square is properly affected by shape.");
101 var rect
= elementRect("s9");
102 assert_equals(rect
.left
, 81);
103 assert_approx_equals(rect
.top
, 101, 0.5);
104 }, "9th square is properly affected by shape.");
107 var rect
= elementRect("s10");
108 assert_equals(rect
.left
, 91);
109 assert_approx_equals(rect
.top
, 99, 0.5);
110 }, "10th square is properly affected by shape.");
113 var rect
= elementRect("s11");
114 assert_equals(rect
.left
, 101);
115 assert_approx_equals(rect
.top
, 91, 0.5);
116 }, "11th square is properly affected by shape.");
119 var rect
= elementRect("s12");
120 assert_equals(rect
.left
, 111);
121 assert_equals(rect
.top
, 1);
122 }, "12th square doesn't overlap shape.");