Bug 633072 - Fix reftests failure by using crispEdge drawing. r=dholbert
authorRobert Longson <longsonr@gmail.com>
Sun, 15 May 2011 09:30:17 +0100
changeset 69539 35de370ddd83c050063f5d3c6d6a1f142ab7bcc3
parent 69538 8b6d6c128641c90f4321963a0453d262633092c1
child 69540 9160c564bf07d4356ae20a4dbb78acb900eba34a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdholbert
bugs633072
milestone6.0a1
Bug 633072 - Fix reftests failure by using crispEdge drawing. r=dholbert
layout/reftests/svg/as-image/img-simple-3-ref.html
layout/reftests/svg/as-image/img-simple-5-ref.html
layout/reftests/svg/as-image/img-simple-7-ref.html
layout/reftests/svg/as-image/reftest.list
layout/reftests/svg/as-image/squaredCircle-100x100.svg
layout/reftests/svg/as-image/squaredCircle-100x50.svg
layout/reftests/svg/as-image/svg-image-util.js
--- a/layout/reftests/svg/as-image/img-simple-3-ref.html
+++ b/layout/reftests/svg/as-image/img-simple-3-ref.html
@@ -1,11 +1,11 @@
 <!DOCTYPE HTML>
 <html>
 <body>
   <svg style="width: 600px; height: 600px"
-       viewBox="0 0 100 100">
+       viewBox="0 0 100 100" shape-rendering="crispEdges">
     <rect x="2" y="2" height="96" width="96"
           stroke-width="4" stroke="black" fill="yellow"/>
     <circle cx="50" cy="50" r="46" style="fill: blue"/>
   </svg>
 </body>
 </html>
--- a/layout/reftests/svg/as-image/img-simple-5-ref.html
+++ b/layout/reftests/svg/as-image/img-simple-5-ref.html
@@ -1,11 +1,12 @@
 <!DOCTYPE HTML>
 <html>
 <body>
   <svg style="width: 200px; height: 600px"
-       viewBox="0 0 100 100" preserveAspectRatio="none">
+       viewBox="0 0 100 100" preserveAspectRatio="none"
+       shape-rendering="crispEdges">
     <rect x="2" y="2" height="96" width="96"
           stroke-width="4" stroke="black" fill="yellow"/>
     <circle cx="50" cy="50" r="46" style="fill: blue"/>
   </svg>
 </body>
 </html>
--- a/layout/reftests/svg/as-image/img-simple-7-ref.html
+++ b/layout/reftests/svg/as-image/img-simple-7-ref.html
@@ -1,10 +1,11 @@
 <html>
 <body>
   <svg style="width: 200px; height: 200px"
-       viewBox="0 0 100 50" preserveAspectRatio="none">
+       viewBox="0 0 100 50" preserveAspectRatio="none"
+       shape-rendering="crispEdges">
     <rect x="2" y="2" height="96" width="96"
           stroke-width="4" stroke="black" fill="yellow"/>
     <circle cx="50" cy="50" r="46" style="fill: blue"/>
   </svg>
 </body>
 </html>
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -39,61 +39,61 @@ fails == canvas-drawImage-scale-2a.html 
 fails == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html # XXX all edges fuzzy
 
 == canvas-drawImage-slice-1a.html lime100x100-ref.html
 fails == canvas-drawImage-slice-1b.html lime100x100-ref.html # XXX all edges fuzzy
 
 # Simple <img> tests
 == img-simple-1.html  lime100x100-ref.html
 == img-simple-2.html  lime100x100-ref.html
-fails-if(d2d) == img-simple-3.html  img-simple-3-ref.html # bug 633072
+== img-simple-3.html  img-simple-3-ref.html
 == img-simple-4.html  lime100x100-ref.html
-fails-if(d2d) == img-simple-5.html  img-simple-5-ref.html # bug 633072
+== img-simple-5.html  img-simple-5-ref.html
 == img-simple-6.html  lime100x100-ref.html
-fails-if(d2d) == img-simple-7.html  img-simple-7-ref.html # bug 633072
+== img-simple-7.html  img-simple-7-ref.html
 
 # Test with mix of <html:img> and <svg:image> referring to the same images,
 # with a variety of preserveAspectRatio values in play.
 fails-if(Android) == img-and-image-1.html img-and-image-1-ref.svg
 
 # More complex <img> tests
 == img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html
 == img-dyn-1.html img-dyn-1-ref.html
 == img-foreignObject-1.html lime100x100-ref.html
 == img-foreignObject-embed-1.html lime100x100-ref.html
 == img-foreignObject-embed-2.html lime100x100-ref.html
 
-fails-if(Android) fails-if(d2d) == img-widthAndHeight-meet-1.html  img-widthAndHeight-meet-1-ref.html # bug 633072
-fails-if(Android) == img-widthAndHeight-meet-2.html  img-widthAndHeight-meet-2-ref.html
-fails-if(Android) fails-if(d2d) == img-widthAndHeight-slice-1.html img-widthAndHeight-slice-1-ref.html # bug 633072
-fails-if(Android) fails-if(d2d) == img-widthAndHeight-slice-2.html img-widthAndHeight-slice-2-ref.html # bug 633072
+== img-widthAndHeight-meet-1.html  img-widthAndHeight-meet-1-ref.html
+== img-widthAndHeight-meet-2.html  img-widthAndHeight-meet-2-ref.html
+== img-widthAndHeight-slice-1.html img-widthAndHeight-slice-1-ref.html
+== img-widthAndHeight-slice-2.html img-widthAndHeight-slice-2-ref.html
 
-fails-if(d2d) == img-height-meet-1.html   img-height-meet-1-ref.html # bug 633072
-fails-if(Android) == img-height-meet-2.html   img-height-meet-2-ref.html
-fails-if(d2d) == img-height-slice-1.html  img-height-slice-1-ref.html # bug 633072
-fails-if(Android) == img-height-slice-2.html  img-height-slice-2-ref.html
+== img-height-meet-1.html   img-height-meet-1-ref.html
+== img-height-meet-2.html   img-height-meet-2-ref.html
+== img-height-slice-1.html  img-height-slice-1-ref.html
+== img-height-slice-2.html  img-height-slice-2-ref.html
 
-fails-if(d2d) == img-width-meet-1.html   img-width-meet-1-ref.html # bug 633072
-fails-if(Android) == img-width-meet-2.html   img-width-meet-2-ref.html
-fails-if(d2d) == img-width-slice-1.html  img-width-slice-1-ref.html # bug 633072
-fails-if(Android) == img-width-slice-2.html  img-width-slice-2-ref.html
+== img-width-meet-1.html   img-width-meet-1-ref.html
+== img-width-meet-2.html   img-width-meet-2-ref.html
+== img-width-slice-1.html  img-width-slice-1-ref.html
+== img-width-slice-2.html  img-width-slice-2-ref.html
 
 # Alternate version of "width & height both non-%-valued" tests, but now
 # with no explicit viewBox, to trigger "synthesize-viewBox" behavior
-fails-if(d2d) == img-novb-widthAndHeight-meet-1-em.html  img-novb-widthAndHeight-all-1-ref.html # bug 633072
-fails-if(d2d) == img-novb-widthAndHeight-meet-1-px.html  img-novb-widthAndHeight-all-1-ref.html # bug 633072
-fails-if(d2d) == img-novb-widthAndHeight-slice-1-em.html img-novb-widthAndHeight-all-1-ref.html # bug 633072
-fails-if(d2d) == img-novb-widthAndHeight-slice-1-px.html img-novb-widthAndHeight-all-1-ref.html # bug 633072
+== img-novb-widthAndHeight-meet-1-em.html  img-novb-widthAndHeight-all-1-ref.html
+== img-novb-widthAndHeight-meet-1-px.html  img-novb-widthAndHeight-all-1-ref.html
+== img-novb-widthAndHeight-slice-1-em.html img-novb-widthAndHeight-all-1-ref.html
+== img-novb-widthAndHeight-slice-1-px.html img-novb-widthAndHeight-all-1-ref.html
 
 # Alternate versions of "only one dimension is non-%-valued" tests, but now
 # with no explicit viewBox, to trigger "synthesize-viewBox" behavior
 == img-novb-height-meet-1.html    img-novb-height-all-1-ref.html
 == img-novb-height-slice-1.html   img-novb-height-all-1-ref.html
-fails-if(d2d) == img-novb-width-meet-1.html     img-novb-width-all-1-ref.html # bug 633072
-fails-if(d2d) == img-novb-width-slice-1.html    img-novb-width-all-1-ref.html # bug 633072
+== img-novb-width-meet-1.html     img-novb-width-all-1-ref.html
+== img-novb-width-slice-1.html    img-novb-width-all-1-ref.html
 
 == list-simple-1.html list-simple-1-ref.html
 
 == svg-image-simple-1.svg lime100x100.svg
 == svg-image-simple-2.svg lime100x100.svg
 == svg-image-simple-3.svg lime100x100.svg
 
 # tests for <svg> files that include themselves as an <image>
--- a/layout/reftests/svg/as-image/squaredCircle-100x100.svg
+++ b/layout/reftests/svg/as-image/squaredCircle-100x100.svg
@@ -1,6 +1,7 @@
 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
-     width="100" height="100">
+     width="100" height="100"
+     shape-rendering="crispEdges">
   <rect x="2" y="2" height="96" width="96"
         stroke-width="4" stroke="black" fill="yellow"/>
   <circle cx="50" cy="50" r="46" style="fill: blue"/>
 </svg>
--- a/layout/reftests/svg/as-image/squaredCircle-100x50.svg
+++ b/layout/reftests/svg/as-image/squaredCircle-100x50.svg
@@ -1,6 +1,7 @@
 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
-     width="100" height="50">
+     width="100" height="50"
+     shape-rendering="crispEdges">
   <rect x="2" y="2" height="96" width="96"
         stroke-width="4" stroke="black" fill="yellow"/>
   <circle cx="50" cy="50" r="46" style="fill: blue"/>
 </svg>
--- a/layout/reftests/svg/as-image/svg-image-util.js
+++ b/layout/reftests/svg/as-image/svg-image-util.js
@@ -64,17 +64,17 @@ const MEETORSLICE_VALS = [ "meet", "slic
  *                      none. (If non-null, implies non-null value for
  *                      aAlign.)
  */
 function generateSVGDataURI(aViewboxArr, aWidth, aHeight,
                             aAlign, aMeetOrSlice) {
   // prefix
   var datauri = "data:image/svg+xml,"
   // Begin the SVG tag
-  datauri += "%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22";
+  datauri += "%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20shape-rendering%3D%22crispEdges%22";
 
   // Append the custom chunk from our params
   datauri += generateSVGAttrsForParams(aViewboxArr, aWidth, aHeight,
                                        aAlign, aMeetOrSlice);
 
   // Put closing leftbracket on SVG tag
   datauri += "%3E";