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

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

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"
     6      xmlns:xlink="http://www.w3.org/1999/xlink"
     7      style="background: red;" class="reftest-wait">
     8   <defs>
     9     <rect fill="lime" width="100%" height="100%" id="r"/>
    10   </defs>
    11   <use id="u" xlink:href="#r" width="0" />
    12   <script type="text/javascript">
    13     <![CDATA[
    15     document.addEventListener("MozReftestInvalidate", doTest, false);
    16     setTimeout(doTest, 4000); // fallback for running outside reftest
    18     function doTest() {
    19         // Since the <use> does not reference an <svg> or <symbol>, the value
    20         // of its 'width' attribute is ignored except to disable/enable its
    21         // rendering by setting it to zero/non-zero. Setting it to a non-zero
    22         // value here should show the entire referenced <rect>. See
    23         // http://www.w3.org/TR/SVG11/struct.html#UseElement
    24         var u = document.getElementById("u");
    25         u.setAttribute("width", "1");
    26         document.documentElement.removeAttribute('class');
    27       }
    29     ]]>
    30 </script>
    31 </svg>

mercurial