layout/reftests/svg/conditions-07.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 id="svg-root" width="100%" height="100%"
     6   xmlns="http://www.w3.org/2000/svg"
     7   xmlns:xlink="http://www.w3.org/1999/xlink" onload="runtest()">
     8   <title>Test conditional processing DOM interface for foreignObject</title>
     9   <defs>
    10     <script>
    11       function runtest() {
    12         try {
    13           var f1 = document.getElementById("f1");
    14           var i0 = f1.requiredFeatures.getItem(0);
    16           if(i0 != "this.is.a.bogus.feature.string") {
    17             return;
    18           }
    19           f1.removeAttribute("requiredFeatures");
    21         } catch(e) {
    22           var f = document.getElementById("fail");
    23           f.setAttribute("fill", "red");
    24         }
    25       }
    26     </script>
    27   </defs>
    29   <rect width="100%" height="100%" fill="lime"/>
    30   <!-- background images -->
    31   <rect x="100" y="100" width="100" height="100" fill="red"/>
    33   <!-- tests -->
    34   <foreignObject id="f1" x="100" y="100" width="100" height="100" requiredFeatures="this.is.a.bogus.feature.string">
    35     <svg>
    36       <rect width="100%" height="100%" fill="lime"/>
    37     </svg>
    38   </foreignObject>
    39   <rect id="fail" width="100%" height="100%" fill="none"/>
    40 </svg>

mercurial