layout/reftests/svg/outer-svg-border-and-padding-01.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" version="1.1" class="reftest-wait"
     6      style="border: 10px solid lime; padding: 10px; background: lime;">
     7   <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=490003 -->
     8   <title>Test that invalidation takes account of outer-&lt;svg&gt; border/padding</title>
     9   <desc>
    10     This test checks that SVG implementations take account of border and
    11     padding on outer &lt;svg&gt; when doing invalidation.
    12   </desc>
    14   <filter id="identity">
    15     <feColorMatrix type="saturate" in="SourceGraphic"/>
    16   </filter>
    18   <script type="text/javascript">//<![CDATA[
    20 function hide_red_rects()
    21 {
    22   var background = document.getElementById("background");
    24   document.getElementById('r').setAttribute('opacity','0');
    25   document.getElementById('f').setAttribute('opacity','0');
    27   <!-- top left -->
    28   document.elementFromPoint(121, 121).setAttribute('opacity','0');
    29   <!-- bottom right -->
    30   document.elementFromPoint(269, 169).setAttribute('opacity','0');
    32   <!-- outside top left -->
    33   if (document.elementFromPoint(119, 119) != background) {
    34     background.setAttribute("fill", "red");
    35   }
    36   <!-- outside bottom right -->
    37   if (document.elementFromPoint(271, 171) != background) {
    38     background.setAttribute("fill", "purple");
    39   }
    41   document.documentElement.removeAttribute('class');
    42 }
    44 document.addEventListener("MozReftestInvalidate", hide_red_rects, false);
    45 setTimeout(hide_red_rects, 4000); // fallback for running outside reftest
    47   //]]>
    48   </script>
    50   <!-- to catch misses-->
    51   <rect id="background" width="100%" height="100%" fill="lime"/>
    53   <rect id="r" width="50" height="50" fill="red"/>
    54   <rect id="f" y="100" width="50" height="50" fill="red"/>
    56   <rect x="100" y="100" width="50" height="50" fill="red"/>
    57   <rect x="200" y="100" width="50" height="50" fill="red"/>
    58 </svg>

mercurial