Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / batik / masking / maskRegions.svg
blob1ef502c382b612b1544206d3335686738ec3b3b1
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
3 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
5 <!--
6 Licensed to the Apache Software Foundation (ASF) under one or more
7 contributor license agreements. See the NOTICE file distributed with
8 this work for additional information regarding copyright ownership.
9 The ASF licenses this file to You under the Apache License, Version 2.0
10 (the "License"); you may not use this file except in compliance with
11 the License. You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20 -->
22 <!-- ========================================================================= -->
23 <!-- Validates processing of mask regions -->
24 <!-- -->
25 <!-- @author vincent.hardy@eng.sun.com -->
26 <!-- @version $Id: maskRegions.svg 475477 2006-11-15 22:44:28Z cam $ -->
27 <!-- ========================================================================= -->
29 <?xml-stylesheet type="text/css" href="../resources/test.css" ?>
31 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
32 <title>Mask</title>
33 <!-- ============================================================= -->
34 <!-- Test content -->
35 <!-- ============================================================= -->
36 <g id="testContent" class="legend" text-anchor="middle">
37 <text x="225" y="50" class="title">
38 Mask Regions
39 </text>
41 <defs>
43 <!-- ======================================== -->
44 <!-- Masked object definition -->
45 <!-- ======================================== -->
46 <linearGradient id="maskedGradient" x1="0" x2="1" y1="0" y2="1" color-interpolation="linearRGB">
47 <stop offset="0" stop-color="blue" />
48 <stop offset="1" stop-color="red" />
49 </linearGradient>
51 <rect id="masked" width="100" height="80" fill="url(#maskedGradient)" />
53 <!-- ======================================= -->
54 <!-- maskUnits: default -->
55 <!-- maskContentUnits: default -->
56 <!-- maskRegion: default (-.1, -.1, 1.2, 1.2)-->
57 <!-- ======================================= -->
58 <mask id="mask_1">
59 <circle cx="25" cy="20" r="20" fill="#ffffff" />
60 <circle cx="25" cy="60" r="20" fill="#ffffff" />
61 <circle cx="75" cy="20" r="20" fill="#ffffff" />
62 <circle cx="75" cy="60" r="20" fill="#ffffff" />
63 </mask>
65 <!-- ======================================= -->
66 <!-- maskUnits: objectBoundingBox -->
67 <!-- maskContentUnits: default -->
68 <!-- maskRegion: (.25, .25, .5, .5) -->
69 <!-- ======================================= -->
70 <mask id="mask_2" maskUnits="objectBoundingBox"
71 x=".25" y="25%" width="50%" height=".5">
72 <circle cx="25" cy="20" r="20" fill="#ffffff" />
73 <circle cx="25" cy="60" r="20" fill="#ffffff" />
74 <circle cx="75" cy="20" r="20" fill="#ffffff" />
75 <circle cx="75" cy="60" r="20" fill="#ffffff" />
76 </mask>
78 <!-- ======================================= -->
79 <!-- maskUnits: userSpaceOnUse -->
80 <!-- maskContentUnits: default -->
81 <!-- maskRegion: (25, 25, 50, 50) -->
82 <!-- ======================================= -->
83 <mask id="mask_3" maskUnits="userSpaceOnUse"
84 x="25" y="20" width="11.11111111%" height="8%">
85 <circle cx="25" cy="20" r="20" fill="#ffffff" />
86 <circle cx="25" cy="60" r="20" fill="#ffffff" />
87 <circle cx="75" cy="20" r="20" fill="#ffffff" />
88 <circle cx="75" cy="60" r="20" fill="#ffffff" />
89 </mask>
91 <!-- ======================================= -->
92 <!-- maskUnits: objectBoundingBox -->
93 <!-- maskContentUnits: default -->
94 <!-- maskRegion: (25, 25, 50, 50) -->
95 <!-- ======================================= -->
96 <mask id="mask_4" maskUnits="objectBoundingBox"
97 maskContentUnits="objectBoundingBox"
98 x="0" y="0" width="100%" height="100%">
99 <circle cx=".25" cy=".2" r=".2" fill="#ffffff" />
100 <circle cx=".25" cy=".5999999" r=".2" fill="#ffffff" />
101 <circle cx=".749999" cy=".2" r=".2" fill="#ffffff" />
102 <circle cx=".749999" cy=".5999999" r=".2" fill="#ffffff" />
103 </mask>
105 </defs>
107 <g transform="translate(175, 100)">
108 <use xlink:href="#masked" />
109 <text x="50" y="-3">Masked</text>
110 </g>
112 <g transform="translate(85, 220)">
113 <use xlink:href="#masked" mask="url(#mask_1)"/>
114 <text x="50" y="-3">Mask 1</text>
115 </g>
117 <g transform="translate(85, 340)">
118 <use xlink:href="#masked" mask="url(#mask_2)"/>
119 <text x="50" y="-3">Mask 2</text>
120 </g>
122 <g transform="translate(260, 220)">
123 <use xlink:href="#masked" mask="url(#mask_3)"/>
124 <text x="50" y="-3">Mask 3</text>
125 </g>
127 <g transform="translate(260, 340)">
128 <use xlink:href="#masked" mask="url(#mask_4)"/>
129 <text x="50" y="-3">Mask 4</text>
130 </g>
132 </g>
134 <!-- ============================================================= -->
135 <!-- Batik sample mark -->
136 <!-- ============================================================= -->
137 <use xlink:href="../resources/batikLogo.svg#Batik_Tag_Box" />
139 </svg>