layout/reftests/svg/dynamic-use-04.svg

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/svg/dynamic-use-04.svg	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     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"
     1.9 +     xmlns:xlink="http://www.w3.org/1999/xlink"
    1.10 +     style="background: red;" class="reftest-wait">
    1.11 +  <defs>
    1.12 +    <rect fill="lime" width="100%" height="100%" id="r"/>
    1.13 +  </defs>
    1.14 +  <use id="u" xlink:href="#r" width="0" />
    1.15 +  <script type="text/javascript">
    1.16 +    <![CDATA[
    1.17 +
    1.18 +    document.addEventListener("MozReftestInvalidate", doTest, false);
    1.19 +    setTimeout(doTest, 4000); // fallback for running outside reftest
    1.20 +
    1.21 +    function doTest() {
    1.22 +        // Since the <use> does not reference an <svg> or <symbol>, the value
    1.23 +        // of its 'width' attribute is ignored except to disable/enable its
    1.24 +        // rendering by setting it to zero/non-zero. Setting it to a non-zero
    1.25 +        // value here should show the entire referenced <rect>. See
    1.26 +        // http://www.w3.org/TR/SVG11/struct.html#UseElement
    1.27 +        var u = document.getElementById("u");
    1.28 +        u.setAttribute("width", "1");
    1.29 +        document.documentElement.removeAttribute('class');
    1.30 +      }
    1.31 +
    1.32 +    ]]>
    1.33 +</script>
    1.34 +</svg>

mercurial