Bug 1291528 - Add reftest to ensure that linear gradient drawing paths agree - r=mstange
☠☠ backed out by d90faf1d38fc ☠ ☠
authorEdwin Flores <eflores@mozilla.com>
Tue, 09 Aug 2016 12:57:59 +0100
changeset 398560 40e95a2eb907cf067af00a3c5b126a344b515fdb
parent 398559 361ac226da2a83516db8d4e4c5b41a69b3ba754f
child 398561 adc1960091eb58583bd65d45fe65e38cbdcd78d8
push id25572
push userbmo:rail@mozilla.com
push dateTue, 09 Aug 2016 13:05:34 +0000
reviewersmstange
bugs1291528
milestone51.0a1
Bug 1291528 - Add reftest to ensure that linear gradient drawing paths agree - r=mstange
layout/reftests/bugs/1291528-ref.html
layout/reftests/bugs/1291528.html
layout/reftests/bugs/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1291528-ref.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title></title>
+    <!--
+      This CSS will hit the non-optimised linear gradient painting path, since
+      the dirty rect of div.inner will be the same as the destination rect,
+      making cellContainsFill true in PaintGradient() and skipping the optimised
+      path.
+    -->
+    <style type="text/css">
+      div.outer {
+        border: 2px solid grey;
+        padding: 0;
+        height: 18.5px;
+        width: 100px;
+      }
+
+      div.inner {
+        margin: 0;
+        padding: 0;
+        border: 0;
+        height: 18.5px;
+        width: 100px;
+        background: linear-gradient(to top, red, blue);
+      }
+    </style>
+  </head>
+  <body>
+    <div class="outer">
+      <div class="inner">
+      </div>
+    </div>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/1291528.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title></title>
+    <!--
+        This test makes sure that linear gradient painting paths agree around
+        non-pixel aligned dimensions: namely, the direct path which draws the
+        linear gradient repeatedly; and the optimised path which converts the
+        original gradient into a repeating gradient and fills the whole
+        destination in one go.
+
+        This CSS will hit the optimised linear gradient painting path, since the
+        dirty rect will be the size of the whole box (including border), but the
+        destination is only the size of the rect within the border.
+    -->
+    <style type="text/css">
+      div {
+        border: 2px solid grey;
+        background: linear-gradient(to top, red, blue);
+        height: 18.5px;
+        width: 100px;
+      }
+    </style>
+  </head>
+  <body>
+    <div>
+    </div>
+  </body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1957,14 +1957,15 @@ fuzzy(100,2000) == 1239564.html 1239564-
 == 1272997-1.html 1272997-1-ref.html
 random-if(!winWidget) == 1273154-1.html 1273154-1-ref.html # depends on Windows font
 random-if(!winWidget) == 1273154-2.html 1273154-2-ref.html # depends on Windows font
 == 1274368-1.html 1274368-1-ref.html
 != 1276161-1a.html 1276161-1-notref.html
 != 1276161-1b.html 1276161-1-notref.html
 != 1276161-1a.html 1276161-1b.html
 == 1275411-1.html 1275411-1-ref.html
+fuzzy(8,1900) == 1291528.html 1291528-ref.html
 
 HTTP == 652991-1a.html 652991-1-ref.html
 HTTP == 652991-1b.html 652991-1-ref.html
 HTTP == 652991-2.html 652991-2-ref.html
 HTTP == 652991-3.html 652991-3-ref.html
 HTTP == 652991-4.html 652991-4-ref.html