1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/svg/stroke-linecap-square-w-zero-length-segs-01.svg Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,143 @@ 1.4 +<!-- 1.5 + Any copyright is dedicated to the Public Domain. 1.6 + http://creativecommons.org/publicdomain/zero/1.0/ 1.7 +--> 1.8 +<svg xmlns="http://www.w3.org/2000/svg"> 1.9 + 1.10 + <title>Test 'stroke-linecap: square' with zero length path segments</title> 1.11 + 1.12 + <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=589648 --> 1.13 + 1.14 + <style> 1.15 + 1.16 +path { 1.17 + stroke-width: 20px; 1.18 + stroke-linecap: square; 1.19 +} 1.20 + 1.21 +rect { 1.22 + fill: red; 1.23 +} 1.24 + 1.25 +/* expect lime squares to cover red rects */ 1.26 +path.squares-expected { 1.27 + stroke: lime; 1.28 +} 1.29 + 1.30 +path.squares-not-expected { 1.31 + stroke: red; 1.32 +} 1.33 + 1.34 +/* thicker stroke to cover squares-not-expected paths */ 1.35 +path.coverer { 1.36 + stroke: lime; 1.37 + stroke-width: 24px; 1.38 +} 1.39 + 1.40 +/* to show edges of shapes to help in debugging: 1.41 +g > rect { 1.42 + stroke: red; 1.43 + stroke-width: 5px; 1.44 +} 1.45 +path.coverer { 1.46 + stroke: lime; 1.47 + stroke-width: 18px; 1.48 +} 1.49 +*/ 1.50 + 1.51 + </style> 1.52 + 1.53 + <rect width="100%" height="100%" style="fill:lime"/> 1.54 + 1.55 + <!-- Column 1: test single segment zero-length subpaths: --> 1.56 + 1.57 + <g transform="translate(25,25)"> 1.58 + <rect x="-9" y="-9" width="18" height="18"/> 1.59 + <rect x="41" y="41" width="18" height="18"/> 1.60 + <rect x="91" y="91" width="18" height="18"/> 1.61 + <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"/> 1.62 + </g> 1.63 + 1.64 + <g transform="translate(25,75)"> 1.65 + <rect x="-9" y="-9" width="18" height="18"/> 1.66 + <rect x="41" y="41" width="18" height="18"/> 1.67 + <rect x="91" y="91" width="18" height="18"/> 1.68 + <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"/> 1.69 + </g> 1.70 + 1.71 + <g transform="translate(25,125)"> 1.72 + <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"/> 1.73 + <path class="coverer" d="M20,20 L30,30 M70,70 L80,80"/> 1.74 + </g> 1.75 + 1.76 + <g transform="translate(25,175)"> 1.77 + <rect x="-9" y="-9" width="18" height="18"/> 1.78 + <rect x="41" y="41" width="18" height="18"/> 1.79 + <rect x="91" y="91" width="18" height="18"/> 1.80 + <path class="squares-expected" d="M0,0 Z M20,20 L30,30 M50,50 Z M70,70 L80,80 M100,100 Z"/> 1.81 + </g> 1.82 + 1.83 + 1.84 + <!-- Column 2: test multi-segment zero-length subpaths: --> 1.85 + 1.86 + <g transform="translate(175,25)"> 1.87 + <rect x="-9" y="-9" width="18" height="18"/> 1.88 + <rect x="41" y="41" width="18" height="18"/> 1.89 + <rect x="91" y="91" width="18" height="18"/> 1.90 + <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"/> 1.91 + </g> 1.92 + 1.93 + <g transform="translate(177,75)"> 1.94 + <rect x="-9" y="-9" width="18" height="18"/> 1.95 + <rect x="41" y="41" width="18" height="18"/> 1.96 + <rect x="91" y="91" width="18" height="18"/> 1.97 + <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"/> 1.98 + </g> 1.99 + 1.100 + <g transform="translate(175,125)"> 1.101 + <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"/> 1.102 + <path class="coverer" d="M20,20 L30,30 M70,70 L80,80"/> 1.103 + </g> 1.104 + 1.105 + <g transform="translate(175,175)"> 1.106 + <rect x="-9" y="-9" width="18" height="18"/> 1.107 + <rect x="41" y="41" width="18" height="18"/> 1.108 + <rect x="91" y="91" width="18" height="18"/> 1.109 + <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"/> 1.110 + </g> 1.111 + 1.112 + 1.113 + <!-- Column 3: test non-zero-length subpaths that begin, end and contain 1.114 + zero length segments: --> 1.115 + 1.116 + <g transform="translate(325,25)"> 1.117 + <path class="squares-not-expected" d="M20,20 L20,20 L30,30 L30,30 L40,40 L40,40"/> 1.118 + <path class="coverer" d="M20,20 L40,40"/> 1.119 + </g> 1.120 + 1.121 + <g transform="translate(325,75)"> 1.122 + <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"/> 1.123 + <path class="coverer" d="M20,20 L40,40"/> 1.124 + </g> 1.125 + 1.126 + <g transform="translate(325,125)"> 1.127 + <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"/> 1.128 + <path class="coverer" d="M20,20 L40,40"/> 1.129 + </g> 1.130 + 1.131 + <!-- this one is shorter because the Z's mean we only have path end points 1.132 + at 20,20 --> 1.133 + <g transform="translate(325,175)"> 1.134 + <rect x="11" y="11" width="18" height="18"/> 1.135 + <path class="squares-expected" d="M20,20 Z L30,30 Z L40,40 Z"/> 1.136 + </g> 1.137 + 1.138 + 1.139 + <!-- Column 4: test loan movetos --> 1.140 + 1.141 + <g transform="translate(425,25)"> 1.142 + <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"/> 1.143 + <path class="coverer" d="M20,20 L30,30 M70,70 L80,80"/> 1.144 + </g> 1.145 + 1.146 +</svg>