Debian Codegraph @

rsvg/tests/fixtures/reftests/filter-effects-region.svg

raw symbols SCIP
1 <svg id="svg-root" width="100%" height="100%"
2 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
4
5 <!-- -10%, -10%, 120%, 120% from the referencing node. -->
6 <filter id="defaults">
7 <feFlood flood-color="green"/>
8 </filter>
9
10 <!-- -10%, -10%, 120%, 120% from the user coordinate system.
11 In this case full image translated to 300, 20
12 as per the group node enclosing the reference node. -->
13 <filter id="usou-defaults" filterUnits="userSpaceOnUse">
14 <feFlood flood-color="green"/>
15 </filter>
16
17 <!-- Fractions of the bounding box on the referencing element. -->
18 <filter id="fractions" x="0.25" y="0.25" width="0.5" height="0.5">
19 <feFlood flood-color="green"/>
20 </filter>
21
22 <!-- Fractions of the bounding box on the referencing element.
23 Note this "em": in this case it's invalid. -->
24 <filter id="fractions-invalid" x="0.25em" y="0.25" width="0.5" height="0.5">
25 <feFlood flood-color="green"/>
26 </filter>
27
28 <!-- Same as above but for the primitive subregion. -->
29 <filter id="fractions-invalid-primitive" primitiveUnits="objectBoundingBox">
30 <feFlood flood-color="green"/>
31 <feOffset width="0.9em" dx="0.5" dy="0.5"/>
32 </filter>
33
34 <!-- According to the spec, the "em" here should use the coordinate system
35 of the referencing node, per filterUnits="userSpaceOnUse". However, the "em" units
36 should resolve with respec to the element's font-size. Firefox (incorrectly?)
37 uses the font-size of the element that referenced the filter. -->
38 <filter id="cascading" filterUnits="userSpaceOnUse" style="font-size: 20px"
39 x="1em" y="1em" width="50" height="50">
40 <feFlood flood-color="green"/>
41 </filter>
42
43 <!-- Same as above but for the default primitiveUnits="userSpaceOnUse"; the primitive's width/height default to 100%
44 with respect to the filter region, whose default is filterUnits="objectBoundingBox".
45 Firefox has the same bug here. -->
46 <filter id="cascading-primitive" style="font-size: 20px">
47 <feFlood x="1em" y="1em" flood-color="green"/>
48 </filter>
49
50 <g transform="translate(30 20)">
51 <rect fill="red" x="1" y="1" width="50" height="50"/>
52 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#defaults)"/>
53 </g>
54
55 <g transform="translate(100 20)">
56 <rect fill="red" x="1" y="1" width="50" height="50"/>
57 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#fractions)"/>
58 </g>
59
60 <g transform="translate(100 100)">
61 <rect fill="red" x="1" y="1" width="50" height="50"/>
62 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#fractions-invalid)"/>
63 </g>
64
65 <g transform="translate(100 180)">
66 <rect fill="red" x="1" y="1" width="50" height="50"/>
67 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#fractions-invalid-primitive)"/>
68 </g>
69
70 <g transform="translate(170 20)" style="font-size: 10px">
71 <rect fill="red" x="1" y="1" width="50" height="50"/>
72 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#cascading)"/>
73 </g>
74
75 <g transform="translate(170 100)" style="font-size: 10px">
76 <rect fill="red" x="1" y="1" width="50" height="50"/>
77 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#cascading-primitive)"/>
78 </g>
79
80 <g transform="translate(300 20)">
81 <rect fill="red" x="1" y="1" width="50" height="50"/>
82 <rect fill="red" x="1" y="1" width="50" height="50" filter="url(#usou-defaults)"/>
83 </g>
84 </svg>