OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../resources/subpixel-utils.js"></script> | |
5 <!-- | |
6 In this test the shape-inside shape is a rounded rectangle configured as a circl
e with radius of 100px. | |
7 The shape-inside element contains a single square Ahem font character that just
fits wthin the circle. | |
8 That means that the character's size is sqrt(2)*100px, which is 141.41356px. | |
9 | |
10 The x and y coordinates of the points at which the square intersects the circle
are half of the | |
11 difference between circle's diameter and the size of the square: (200px - sqrt(2
)*100px) / 2 = 29.2893219px. | |
12 --> | |
13 <style> | |
14 #shape-container { | |
15 position: relative; | |
16 display: inline-block; | |
17 width: 200px; | |
18 height: 200px; | |
19 margin: 10px; | |
20 } | |
21 | |
22 #shape-background { | |
23 position: absolute; | |
24 top: 0px; | |
25 left: 0px; | |
26 width: 200px; | |
27 height: 200px; | |
28 border-radius: 100px / 100px; | |
29 background-color: rgb(200,200,200); | |
30 } | |
31 | |
32 #shape-inside { | |
33 position: absolute; | |
34 top: 29.2893219px; | |
35 left: 29.2893219px; | |
36 width: 200px; | |
37 height: 200px; | |
38 font: 141.421356px/1 Ahem, sans-serif; | |
39 color: green; | |
40 } | |
41 </style> | |
42 </head> | |
43 <body onload="init()"> | |
44 <script> | |
45 function init() { | |
46 if (!SubPixelLayout.isEnabled()) | |
47 document.getElementById("shape-inside").style.top = "30px"; | |
48 } | |
49 </script> | |
50 <p>The green rectangle should appear within the grey circle.</p> | |
51 <div id="shape-container"> | |
52 <div id="shape-background"></div> | |
53 <div id="shape-inside">X</div> | |
54 </div> | |
55 </body> | |
56 </html> | |
OLD | NEW |