OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <script src="../resources/subpixel-utils.js"></script> |
5 <script> | 6 <script> |
6 if (window.internals) | 7 if (window.internals) |
7 window.internals.settings.setCSSExclusionsEnabled(true); | 8 window.internals.settings.setCSSExclusionsEnabled(true); |
8 </script> | 9 </script> |
9 <style> | 10 <style> |
10 #shape-inside { | 11 #shape-inside { |
11 position: relative; | 12 position: relative; |
12 margin: 0; | 13 margin: 0; |
13 padding: 0; | 14 padding: 0; |
14 width: 500px; | 15 width: 500px; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 64 |
64 a = Math.atan2(175, 200) | 65 a = Math.atan2(175, 200) |
65 left = 2 * 50 * (200 / 175) + (50 / Math.sin(a)) | 66 left = 2 * 50 * (200 / 175) + (50 / Math.sin(a)) |
66 | 67 |
67 The perpindicular distance between the polygon edge and the padded edge is
50 (the shape-padding value), | 68 The perpindicular distance between the polygon edge and the padded edge is
50 (the shape-padding value), |
68 and a is the angle between the edges and the X axis, so 50/Math.sin(a), is
the horizontal distance | 69 and a is the angle between the edges and the X axis, so 50/Math.sin(a), is
the horizontal distance |
69 between the polygon edge and its padded edge. | 70 between the polygon edge and its padded edge. |
70 | 71 |
71 */ | 72 */ |
72 | 73 |
| 74 var quiet = true; // PASS output depends on SubPixelLayout.isEnabled() |
| 75 |
73 shouldBe("shapeInsideRect('a').top", "50"); | 76 shouldBe("shapeInsideRect('a').top", "50"); |
74 shouldBeCloseTo("shapeInsideRect('a').left", 190.215, 1); | 77 shouldBeCloseTo("shapeInsideRect('a').left", SubPixelLayout.snapToLayoutUnit(1
90.215), 1, quiet); |
75 shouldBe("shapeInsideRect('a').width", "150"); | 78 shouldBe("shapeInsideRect('a').width", "150"); |
76 | 79 |
77 shouldBe("shapeInsideRect('b').top", "150"); | 80 shouldBe("shapeInsideRect('b').top", "150"); |
78 shouldBeCloseTo("shapeInsideRect('b').left", 250, 1) | 81 shouldBeCloseTo("shapeInsideRect('b').left", 250, 1) |
79 shouldBe("shapeInsideRect('b').width", "100"); | 82 shouldBe("shapeInsideRect('b').width", "100"); |
80 | 83 |
81 shouldBe("shapeInsideRect('c').top", "250"); | 84 shouldBe("shapeInsideRect('c').top", "250"); |
82 shouldBeCloseTo("shapeInsideRect('c').left", 190.215, 1); | 85 shouldBeCloseTo("shapeInsideRect('c').left", SubPixelLayout.snapToLayoutUnit(1
90.215), 1, quiet); |
83 shouldBe("shapeInsideRect('c').width", "150"); | 86 shouldBe("shapeInsideRect('c').width", "150"); |
84 </script> | 87 </script> |
85 </html> | 88 </html> |
86 | 89 |
OLD | NEW |