Bug 1291528 - Add reftest to ensure that linear gradient drawing paths agree. r=mstange, a=ritu
authorEdwin Flores <eflores@mozilla.com>
Wed, 17 Aug 2016 09:26:11 +0100
changeset 348181 d16c69ae7598faae957bfc58311cee859dab1632
parent 348180 e595d844f05d603bf1b069241b2ac52774ae8a6b
child 348182 c9d493c82e38023fd0a4f59bc7b60123bb66d170
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, ritu
bugs1291528
milestone50.0a2
Bug 1291528 - Add reftest to ensure that linear gradient drawing paths agree. r=mstange, a=ritu
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,13 +1957,14 @@ 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
 # Buttons in 2 pages have different position and the rendering result can be
 # different, but they should use the same button style and the background color
 # should be same.  |fuzzy()| here allows the difference in border, but not
 # background color.
 fuzzy(255,1000) skip-if(!cocoaWidget) == 1294102-1.html 1294102-1-ref.html