Fri, 16 Jan 2015 18:13:44 +0100
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 xmlns:xlink="http://www.w3.org/1999/xlink"
7 onload="startTest()">
8 <title>Testing that dynamic changes to the parent element are reflected in gradients</title>
9 <defs id="d">
10 <linearGradient id="g1" gradientUnits="objectBoundingBox" x2="0" y2="1">
11 <stop stop-color="red" offset="0"/>
12 <stop stop-color="red" offset="1"/>
13 </linearGradient>
14 <linearGradient id="g2" gradientUnits="objectBoundingBox" x2="0" y2="1">
15 <stop stop-color="lime" offset="0"/>
16 <stop stop-color="lime" offset="1"/>
17 </linearGradient>
18 </defs>
20 <g id="g" fill="url(#g1)">
21 <rect id="u1" width="100%" height="100%" />
22 </g>
24 <script>
25 function startTest() {
26 document.addEventListener("MozReftestInvalidate", doTest, false);
27 setTimeout(doTest, 4000); // fallback for running outside reftest
28 }
30 function doTest() {
31 document.getElementById("g").setAttribute("fill", "url(#g2)");
32 document.documentElement.removeAttribute("class");
33 }
34 </script>
35 </svg>