blob: 7690f8bb11c8fc4f0b9b8b7b23e2c6345db99def (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<title>Testcase for clipPath referencing other clipPaths</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=534612 -->
<defs>
<clipPath id="clip1">
<rect id="r1" x="20" y="-40" width="100" height="40" />
</clipPath>
<clipPath id="clip2">
<rect x="20" y="20" width="100" height="100" clip-path="url(#clip1)" />
</clipPath>
<clipPath id="clip3">
<rect x="140" y="-40" width="100" height="40" />
</clipPath>
<clipPath id="clip4" clip-path="url(#clip3)">
<rect x="140" y="20" width="100" height="100" />
</clipPath>
<clipPath id="clip1">
<rect x="20" y="-40" width="100" height="40" />
</clipPath>
<clipPath id="clip5">
<rect id="r5" x="20" y="140" width="100" height="100" />
</clipPath>
<clipPath id="clip6">
<use xlink:href="#r5" clip-path="url(#clip5)" />
</clipPath>
<clipPath id="clip7">
<rect id="r7" x="140" y="140" width="100" height="100" />
</clipPath>
<clipPath id="clip8">
<use xlink:href="#r7" fill="red" clip-path="url(#clip1)"/>
</clipPath>
<clipPath id="clip9">
<rect x="20" y="260" width="100" height="100" />
</clipPath>
<clipPath id="clip10">
<use xlink:href="#r1" fill="red" clip-path="url(#clip9)"/>
</clipPath>
<clipPath id="clip11">
<rect id="r11" x="140" y="260" width="100" height="100" clip-path="url(#clip1)"/>
</clipPath>
<clipPath id="clip12">
<use xlink:href="#r11" fill="red" clip-path="url(#clip11)"/>
</clipPath>
<clipPath id="clip12" clipPathUnits="objectBoundingBox">
<rect width=".5" height=".5"/>
</clipPath>
<clipPath id="clip13" clip-path="url(#clip12)">
<circle cx="100" cy="470" r="150"/>
</clipPath>
<clipPath id="clip14">
<use xlink:href="#clip1"/>
</clipPath>
<clipPath id="clip15" clip-path="url(#clip14)">
<text x="140" y="500" font-size="100px">CLIP</text>
</clipPath>
</defs>
<rect width="100%" height="100%" fill="lime" />
<!-- clip path where an object is itself clipped -->
<rect x="20" y="20" width="100" height="100" fill="red" clip-path="url(#clip2)" />
<!-- clip path referencing another clip-path -->
<rect x="140" y="20" width="100" height="100" fill="red" clip-path="url(#clip4)" />
<!-- clip paths where object has complex clipping -->
<rect x="20" y="140" width="100" height="100" fill="red" />
<rect x="20" y="140" width="100" height="100" fill="lime" clip-path="url(#clip6)" />
<rect x="140" y="140" width="100" height="100" fill="red" clip-path="url(#clip8)" />
<rect x="20" y="260" width="100" height="100" fill="red" clip-path="url(#clip10)" />
<rect x="140" y="260" width="100" height="100" fill="red" clip-path="url(#clip12)" />
<!-- clip paths with different clipPathUnits -->
<rect x="20" y="400" height="300" width="300" fill="red" clip-path="url(#clip13)" />
<rect x="20" y="400" width="100" height="100" fill="lime" />
<!-- text clipping -->
<rect x="140" y="400" height="300" width="300" fill="red" clip-path="url(#clip15)" />
</svg>
|