Bug 695677: Add <use> element to svg-image-script-2.svg, to force its resources file to load before onload fires. r=longsonr
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 30 Dec 2011 05:03:08 -0800
changeset 84801 aee26fea635fca5ee712b161a3e65d589b4b7d0a
parent 84795 9fdaea5d67e2f1f97045700e7fe92b4eb277f12b
child 84802 e1b00c29bf03a01186b1541e4ead4de144592c77
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs695677
milestone12.0a1
Bug 695677: Add <use> element to svg-image-script-2.svg, to force its resources file to load before onload fires. r=longsonr
layout/reftests/svg/as-image/script100x100.svg
layout/reftests/svg/as-image/svg-image-script-2.svg
--- a/layout/reftests/svg/as-image/script100x100.svg
+++ b/layout/reftests/svg/as-image/script100x100.svg
@@ -1,11 +1,15 @@
 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
      width="100" height="100">
   <defs>
+    <!-- So that other documents can svg:use this one and force it to
+         load before onload -->
+    <g id="empty" />
+
     <pattern id="p1" patternUnits="userSpaceOnUse" width="100%" height="100%">
       <rect width="100%" height="100%" fill="lime"/>
       <rect id="r1" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Script" width="100%" height="100%" fill="orange"/>
     </pattern>
   </defs>
   <rect width="100%" height="100%" fill="lime"/>
   <rect requiredFeatures="http://www.w3.org/TR/SVG11/feature#Script" width="100%" height="100%" fill="blue"/>
 </svg>
--- a/layout/reftests/svg/as-image/svg-image-script-2.svg
+++ b/layout/reftests/svg/as-image/svg-image-script-2.svg
@@ -1,11 +1,15 @@
 <svg xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      width="100" height="100" class="reftest-wait">
+
+  <!-- This <use> just forces our resources file to load before onload fires -->
+  <use xlink:href="script100x100.svg#empty" />
+
   <rect width="100%" height="100%" fill="red"/>
   <rect width="100%" height="100%" fill="url(script100x100.svg#p1)"/>
   <rect id="r1" width="100%" height="100%" fill="transparent"/>
   <script type="application/javascript">
     document.addEventListener("MozReftestInvalidate", doTest, false);
     // in case we're not gecko
     setTimeout(doTest, 5000);