Bug 1449118 - Force SVGs to load when running the twisty reftest. r=dholbert draft
authorTim Nguyen <ntim.bugs@gmail.com>
Wed, 28 Mar 2018 21:38:31 +0000
changeset 774426 dabe4a34d31de13b7d2d42d054463ccef3020913
parent 773564 56d6db4ad38c869d0bbc2aea449a4a382f109163
push id104395
push userbmo:ntim.bugs@gmail.com
push dateWed, 28 Mar 2018 21:39:00 +0000
reviewersdholbert
bugs1449118
milestone61.0a1
Bug 1449118 - Force SVGs to load when running the twisty reftest. r=dholbert MozReview-Commit-ID: HxU0B0Bxwgp
layout/reftests/xul/reftest.list
layout/reftests/xul/treetwisty-svg-context-paint-1-not-ref.xul
layout/reftests/xul/treetwisty-svg-context-paint-1-ref.xul
layout/reftests/xul/treetwisty-svg-context-paint-1.xul
--- a/layout/reftests/xul/reftest.list
+++ b/layout/reftests/xul/reftest.list
@@ -70,9 +70,11 @@ fails == object-fit-fill-svg-006.xul obj
 # Tests for rendering SVG images in a XUL <treecell>:
 # XXXdholbert: These are marked as "random" right now, since they might not
 # render the images they trying to test in time for the reftest snapshot, per
 # bug 1218954.
 skip == treecell-image-svg-1a.xul treecell-image-svg-1-ref.xul # bug 1218954
 skip == treecell-image-svg-1b.xul treecell-image-svg-1-ref.xul # bug 1218954
 
 == treechildren-padding-percent-1.xul treechildren-padding-percent-1-ref.xul
-test-pref(svg.context-properties.content.enabled,true) == treetwisty-svg-context-paint-1.xul treetwisty-svg-context-paint-1-ref.xul
\ No newline at end of file
+
+!= treetwisty-svg-context-paint-1-not-ref.xul treetwisty-svg-context-paint-1-ref.xul
+test-pref(svg.context-properties.content.enabled,true) == treetwisty-svg-context-paint-1.xul treetwisty-svg-context-paint-1-ref.xul
new file mode 100644
--- /dev/null
+++ b/layout/reftests/xul/treetwisty-svg-context-paint-1-not-ref.xul
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml">
+  <html:style>
+    treechildren::-moz-tree-twisty {
+      -moz-appearance: none !important;
+      -moz-context-properties: none !important;
+      list-style: none !important;
+    }
+  </html:style>
+  <tree seltype="single" flex="1">
+    <treecols>
+      <treecol flex="1" primary="true"/>
+    </treecols>
+    <treechildren>
+      <treeitem>
+        <treerow>
+          <treecell label="I am a treecell"></treecell>
+        </treerow>
+      </treeitem>
+      <treeitem container="true" open="true">
+        <treerow>
+          <treecell label="Folder"></treecell>
+        </treerow>
+        <treechildren>
+          <treeitem>
+            <treerow>
+              <treecell label="I am a treecell"></treecell>
+            </treerow>
+          </treeitem>
+        </treechildren>
+      </treeitem>
+    </treechildren>
+  </tree>
+</window>
--- a/layout/reftests/xul/treetwisty-svg-context-paint-1-ref.xul
+++ b/layout/reftests/xul/treetwisty-svg-context-paint-1-ref.xul
@@ -1,14 +1,19 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
+  <image src="treetwisty-no-context-paint.svg" id="preload-image"/>
   <html:style>
+    #preload-image {
+      visibility: collapse;
+    }
+
     treechildren::-moz-tree-twisty {
       -moz-appearance: none !important;
       -moz-context-properties: none !important;
       list-style-image: url(treetwisty-no-context-paint.svg);
     }
   </html:style>
   <tree seltype="single" flex="1">
     <treecols>
--- a/layout/reftests/xul/treetwisty-svg-context-paint-1.xul
+++ b/layout/reftests/xul/treetwisty-svg-context-paint-1.xul
@@ -1,14 +1,20 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml">
+  <image src="treetwisty-context-paint.svg" id="preload-image"/>
   <html:style>
+    #preload-image {
+      visibility: collapse;
+    }
+
+    #preload-image,
     treechildren::-moz-tree-twisty {
       -moz-appearance: none !important;
       -moz-context-properties: fill, fill-opacity, stroke, stroke-opacity !important;
       fill: green;
       fill-opacity: 0.5;
       stroke: purple;
       stroke-opacity: 0.2;
       list-style-image: url(treetwisty-context-paint.svg);