|
1 <!-- |
|
2 Any copyright is dedicated to the Public Domain. |
|
3 http://creativecommons.org/publicdomain/zero/1.0/ |
|
4 --> |
|
5 <svg xmlns="http://www.w3.org/2000/svg"> |
|
6 |
|
7 <title>Test 'stroke-linecap: square' with zero length path segments</title> |
|
8 |
|
9 <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=589648 --> |
|
10 |
|
11 <style> |
|
12 |
|
13 path { |
|
14 stroke-width: 20px; |
|
15 stroke-linecap: square; |
|
16 } |
|
17 |
|
18 rect { |
|
19 fill: red; |
|
20 } |
|
21 |
|
22 /* expect lime squares to cover red rects */ |
|
23 path.squares-expected { |
|
24 stroke: lime; |
|
25 } |
|
26 |
|
27 path.squares-not-expected { |
|
28 stroke: red; |
|
29 } |
|
30 |
|
31 /* thicker stroke to cover squares-not-expected paths */ |
|
32 path.coverer { |
|
33 stroke: lime; |
|
34 stroke-width: 24px; |
|
35 } |
|
36 |
|
37 /* to show edges of shapes to help in debugging: |
|
38 g > rect { |
|
39 stroke: red; |
|
40 stroke-width: 5px; |
|
41 } |
|
42 path.coverer { |
|
43 stroke: lime; |
|
44 stroke-width: 18px; |
|
45 } |
|
46 */ |
|
47 |
|
48 </style> |
|
49 |
|
50 <rect width="100%" height="100%" style="fill:lime"/> |
|
51 |
|
52 <!-- Column 1: test single segment zero-length subpaths: --> |
|
53 |
|
54 <g transform="translate(25,25)"> |
|
55 <rect x="-9" y="-9" width="18" height="18"/> |
|
56 <rect x="41" y="41" width="18" height="18"/> |
|
57 <rect x="91" y="91" width="18" height="18"/> |
|
58 <path class="squares-expected" d="M0,0 L0,0 M20,20 L30,30 M50,50 L50,50 M70,70 L80,80 M100,100 L100,100"/> |
|
59 </g> |
|
60 |
|
61 <g transform="translate(25,75)"> |
|
62 <rect x="-9" y="-9" width="18" height="18"/> |
|
63 <rect x="41" y="41" width="18" height="18"/> |
|
64 <rect x="91" y="91" width="18" height="18"/> |
|
65 <path class="squares-expected" d="M0,0 C0,0 0,0 0,0 M20,20 L30,30 M50,50 C50,50 50,50 50,50 M70,70 L80,80 M100,100 C100,100 100,100 100,100"/> |
|
66 </g> |
|
67 |
|
68 <g transform="translate(25,125)"> |
|
69 <path class="squares-not-expected" d="M0,0 A0,10 0 0 0 0,0 M20,20 L30,30 M50,50 A0,10 0 0 0 50,50 M70,70 L80,80 M100,100 A0,10 0 0 0 100,100"/> |
|
70 <path class="coverer" d="M20,20 L30,30 M70,70 L80,80"/> |
|
71 </g> |
|
72 |
|
73 <g transform="translate(25,175)"> |
|
74 <rect x="-9" y="-9" width="18" height="18"/> |
|
75 <rect x="41" y="41" width="18" height="18"/> |
|
76 <rect x="91" y="91" width="18" height="18"/> |
|
77 <path class="squares-expected" d="M0,0 Z M20,20 L30,30 M50,50 Z M70,70 L80,80 M100,100 Z"/> |
|
78 </g> |
|
79 |
|
80 |
|
81 <!-- Column 2: test multi-segment zero-length subpaths: --> |
|
82 |
|
83 <g transform="translate(175,25)"> |
|
84 <rect x="-9" y="-9" width="18" height="18"/> |
|
85 <rect x="41" y="41" width="18" height="18"/> |
|
86 <rect x="91" y="91" width="18" height="18"/> |
|
87 <path class="squares-expected" d="M0,0 L0,0 M0,0 L0,0 M20,20 L30,30 M50,50 L50,50 L50,50 M70,70 L80,80 M100,100 L100,100 L100,100"/> |
|
88 </g> |
|
89 |
|
90 <g transform="translate(177,75)"> |
|
91 <rect x="-9" y="-9" width="18" height="18"/> |
|
92 <rect x="41" y="41" width="18" height="18"/> |
|
93 <rect x="91" y="91" width="18" height="18"/> |
|
94 <path class="squares-expected" d="M0,0 C0,0 0,0 0,0 C0,0 0,0 0,0 M20,20 L30,30 M50,50 C50,50 50,50 50,50 C50,50 50,50 50,50 M70,70 L80,80 M100,100 C100,100 100,100 100,100 C100,100 100,100 100,100"/> |
|
95 </g> |
|
96 |
|
97 <g transform="translate(175,125)"> |
|
98 <path class="squares-not-expected" d="M0,0 A0,10 0 0 0 0,0 A0,10 0 0 0 0,0 M20,20 L30,30 M50,50 A0,10 0 0 0 50,50 A0,10 0 0 0 50,50 M70,70 L80,80 M100,100 A0,10 0 0 0 100,100 A0,10 0 0 0 100,100"/> |
|
99 <path class="coverer" d="M20,20 L30,30 M70,70 L80,80"/> |
|
100 </g> |
|
101 |
|
102 <g transform="translate(175,175)"> |
|
103 <rect x="-9" y="-9" width="18" height="18"/> |
|
104 <rect x="41" y="41" width="18" height="18"/> |
|
105 <rect x="91" y="91" width="18" height="18"/> |
|
106 <path class="squares-expected" d="M0,0 Z Z M20,20 L30,30 M50,50 Z Z M70,70 L80,80 M100,100 Z Z"/> |
|
107 </g> |
|
108 |
|
109 |
|
110 <!-- Column 3: test non-zero-length subpaths that begin, end and contain |
|
111 zero length segments: --> |
|
112 |
|
113 <g transform="translate(325,25)"> |
|
114 <path class="squares-not-expected" d="M20,20 L20,20 L30,30 L30,30 L40,40 L40,40"/> |
|
115 <path class="coverer" d="M20,20 L40,40"/> |
|
116 </g> |
|
117 |
|
118 <g transform="translate(325,75)"> |
|
119 <path class="squares-not-expected" d="M20,20 C20,20 20,20 20,20 C20,20 30,30 30,30 C30,30 30,30 30,30 C30,30 40,40 40,40 C40,40 40,40 40,40"/> |
|
120 <path class="coverer" d="M20,20 L40,40"/> |
|
121 </g> |
|
122 |
|
123 <g transform="translate(325,125)"> |
|
124 <path class="squares-not-expected" d="M20,20 A0,10 0 0 0 20,20 A0,10 0 0 0 30,30 A0,10 0 0 0 30,30 A0,10 0 0 0 40,40 A0,10 0 0 0 40,40"/> |
|
125 <path class="coverer" d="M20,20 L40,40"/> |
|
126 </g> |
|
127 |
|
128 <!-- this one is shorter because the Z's mean we only have path end points |
|
129 at 20,20 --> |
|
130 <g transform="translate(325,175)"> |
|
131 <rect x="11" y="11" width="18" height="18"/> |
|
132 <path class="squares-expected" d="M20,20 Z L30,30 Z L40,40 Z"/> |
|
133 </g> |
|
134 |
|
135 |
|
136 <!-- Column 4: test loan movetos --> |
|
137 |
|
138 <g transform="translate(425,25)"> |
|
139 <path class="squares-not-expected" d="M0,0 M0,0 M20,20 L30,30 M50,50 M50,50 M70,70 L80,80 M100,100 M100,100"/> |
|
140 <path class="coverer" d="M20,20 L30,30 M70,70 L80,80"/> |
|
141 </g> |
|
142 |
|
143 </svg> |