layout/reftests/svg/dynamic-mask-01.svg

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/svg/dynamic-mask-01.svg	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     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" version="1.1"
     1.9 +     class="reftest-wait"
    1.10 +     onload="startTest()"
    1.11 +     xmlns:xlink="http://www.w3.org/1999/xlink">
    1.12 +  <title>Testing that dynamic changes to mask attributes are reflected in the mask</title>
    1.13 +
    1.14 +  <defs>
    1.15 +    <mask id="mask1" width="1" height="1">
    1.16 +      <rect width="1" height="1" fill="white"/>
    1.17 +    </mask>
    1.18 +    <mask id="mask2" width="1" height="1">
    1.19 +      <rect width="1" height="1" fill="white"/>
    1.20 +    </mask>
    1.21 +    <mask id="mask3" width="1" height="1">
    1.22 +      <rect width="1" height="1" fill="white"/>
    1.23 +    </mask>
    1.24 +  </defs>
    1.25 +
    1.26 +  <rect width="100%" height="100%" fill="lime"/>
    1.27 +
    1.28 +  <g transform="scale(500)">
    1.29 +    <rect x=".2" y=".2" width=".2" height=".2" fill="red" mask="url(#mask1)"/>
    1.30 +    <rect x=".4" y=".2" width=".2" height=".2" fill="red" mask="url(#mask2)"/>
    1.31 +    <rect x=".2" y=".4" width=".2" height=".2" fill="red" mask="url(#mask3)" />
    1.32 +  </g>
    1.33 +
    1.34 +  <script>
    1.35 +    function startTest() {
    1.36 +      document.addEventListener("MozReftestInvalidate", doTest, false);
    1.37 +      setTimeout(doTest, 4000); // fallback for running outside reftest
    1.38 +    }
    1.39 +
    1.40 +    function doTest() {
    1.41 +      var mask1 = document.getElementById("mask1");
    1.42 +      mask1.width.baseVal.value = 0;
    1.43 +      var mask2 = document.getElementById("mask2");
    1.44 +      mask2.height.baseVal.value = 0;
    1.45 +      var mask3 = document.getElementById("mask3");
    1.46 +      mask3.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
    1.47 +
    1.48 +      document.documentElement.removeAttribute("class");
    1.49 +    }
    1.50 +  </script>
    1.51 +</svg>

mercurial