Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
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" version="1.1"
6 class="reftest-wait"
7 onload="startTest()"
8 xmlns:xlink="http://www.w3.org/1999/xlink">
9 <title>Testing that dynamic changes to mask attributes are reflected in the mask</title>
11 <defs>
12 <mask id="mask1" width="1" height="1">
13 <rect width="1" height="1" fill="white"/>
14 </mask>
15 <mask id="mask2" width="1" height="1">
16 <rect width="1" height="1" fill="white"/>
17 </mask>
18 <mask id="mask3" width="1" height="1">
19 <rect width="1" height="1" fill="white"/>
20 </mask>
21 </defs>
23 <rect width="100%" height="100%" fill="lime"/>
25 <g transform="scale(500)">
26 <rect x=".2" y=".2" width=".2" height=".2" fill="red" mask="url(#mask1)"/>
27 <rect x=".4" y=".2" width=".2" height=".2" fill="red" mask="url(#mask2)"/>
28 <rect x=".2" y=".4" width=".2" height=".2" fill="red" mask="url(#mask3)" />
29 </g>
31 <script>
32 function startTest() {
33 document.addEventListener("MozReftestInvalidate", doTest, false);
34 setTimeout(doTest, 4000); // fallback for running outside reftest
35 }
37 function doTest() {
38 var mask1 = document.getElementById("mask1");
39 mask1.width.baseVal.value = 0;
40 var mask2 = document.getElementById("mask2");
41 mask2.height.baseVal.value = 0;
42 var mask3 = document.getElementById("mask3");
43 mask3.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
45 document.documentElement.removeAttribute("class");
46 }
47 </script>
48 </svg>