OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 .box { | 5 .box { |
6 width: 450px; | 6 width: 450px; |
7 height: 100px; | 7 height: 100px; |
8 line-height: 20px; | 8 line-height: 20px; |
9 outline: 2px solid green; | 9 outline: 2px solid green; |
10 } | 10 } |
11 | 11 |
12 .rectangle { | 12 .polygon { |
13 shape-inside: rectangle(25px, 25px, 400px, 50px); | 13 -webkit-shape-inside: polygon(25px 25px, 425px 25px, 425px 75px, 25px 75px); |
14 } | |
15 | |
16 .rounded-rectangle { | |
17 width: 100px; | |
18 height: 100px; | |
19 shape-inside: rectangle(0, 0, 100%, 100%, 25%, 25%); | |
20 } | |
21 | |
22 .smaller-rounded-rectangle { | |
23 width: 100px; | |
24 height: 100px; | |
25 shape-inside: rectangle(0, 0, 75%, 75%, 25%, 25%); | |
26 } | 14 } |
27 | 15 |
28 .details { | 16 .details { |
29 padding-top: 15px; | 17 padding-top: 15px; |
30 font-style: italic; | 18 font-style: italic; |
31 } | 19 } |
32 </style> | 20 </style> |
33 </head> | 21 </head> |
34 | 22 |
35 <body> | 23 <body> |
36 <div class="box rectangle"> | 24 <div class="box polygon"> |
37 <p style="padding-top: 55px;">Content1</p> | 25 <p style="padding-top: 55px;">Content1</p> |
38 </div> | 26 </div> |
39 <p class="details">There is a 400x50px shape-inside rectangle inside the green b
ox.<br/>The Content1 text line's bottom equals to the shape-inside's rectangle b
ottom boundary, so it should fit in the shape-inside.</p> | 27 <p class="details">There is a 400x50px shape-inside polygon inside the green box
.<br/>The Content1 text line's bottom equals to the shape-inside's polygon botto
m boundary, so it should fit in the shape-inside.</p> |
40 <hr> | 28 <hr> |
41 | 29 |
42 <div class="box rectangle"> | 30 <div class="box polygon"> |
43 <p style="padding-top: 60px;">Content2</p> | 31 <p style="padding-top: 60px;">Content2</p> |
44 </div> | 32 </div> |
45 <p class="details">There is a 400x50px shape-inside rectangle inside the green b
ox.<br/>The Content2 text line overlaps with the shape-inside's rectangle bottom
boundary, so the Content2 should be pushed below the content box.</p> | 33 <p class="details">There is a 400x50px shape-inside polygon inside the green box
.<br/>The Content2 text line overlaps with the shape-inside's polygon bottom bou
ndary, so the Content2 should be pushed below the content box.</p> |
46 <hr> | 34 <hr> |
47 | 35 |
48 <div class="box rectangle"> | 36 <div class="box polygon"> |
49 <p style="padding-top: 76px;">Content3</p> | 37 <p style="padding-top: 76px;">Content3</p> |
50 </div> | 38 </div> |
51 <p class="details">There is a 400x50px shape-inside rectangle inside the green b
ox.<br/>The Content3 text line starts after the shape-inside's rectangle bottom
boundary, so the Content3 should be pushed below the content box.</p> | 39 <p class="details">There is a 400x50px shape-inside polygon inside the green box
.<br/>The Content3 text line starts after the shape-inside's polygon bottom boun
dary, so the Content3 should be pushed below the content box.</p> |
52 <hr> | |
53 | |
54 <div class="box rounded-rectangle"> | |
55 <p style="padding-top: 90px;">Content4</p> | |
56 </div> | |
57 <p class="details">There is a 100x100px shape-inside rounded rectangle inside th
e green box.<br/>The shape top and bottom boundaries match with the content box
boundaries, the overflow should start on the left, below the green content box.<
/p> | |
58 <hr> | |
59 | |
60 <div class="box smaller-rounded-rectangle"> | |
61 <p style="padding-top: 60px;">Content5</p> | |
62 </div> | |
63 <p class="details">There is a 75x75px shape-inside rounded rectangle inside the
green 100x100px box.<br/>The forth line should overflow, the overflow should sta
rt on the left, below the green content box.</p> | |
64 <hr> | 40 <hr> |
65 | 41 |
66 <p>Based on a recent change on the <a href="http://dev.w3.org/csswg/css-exclusio
ns/#shape-inside-property">exclusions specification</a>. The 'shape-inside' prop
erty adds an exclusion area to the element's wrapping context. | 42 <p>Based on a recent change on the <a href="http://dev.w3.org/csswg/css-exclusio
ns/#shape-inside-property">exclusions specification</a>. The 'shape-inside' prop
erty adds an exclusion area to the element's wrapping context. |
67 This modifies the normal rectangular shape of the content area to a possibly non
-rectangular wrapping area. The exclusion area added is defined by subtracting t
he shape from the element's content area.</p> | 43 This modifies the normal rectangular shape of the content area to a possibly non
-rectangular wrapping area. The exclusion area added is defined by subtracting t
he shape from the element's content area.</p> |
68 <p>Bug <a href="http://webkit.org/b/114526 ">114526</a>: [CSS Exclusions] shape-
inside overflow should be pushed to the outside of the content box</p> | 44 <p>Bug <a href="http://webkit.org/b/114526 ">114526</a>: [CSS Exclusions] shape-
inside overflow should be pushed to the outside of the content box</p> |
69 </body> | 45 </body> |
70 </html> | 46 </html> |
OLD | NEW |