Bug 1467622 - P2: Change SMIL paced tests to represent new distance calc. r?birtles draft
authorDan Glastonbury <dan.glastonbury@gmail.com>
Thu, 28 Jun 2018 11:58:34 +1000
changeset 817195 9a9d1f6d752f54a13fc4a1b035474d7c70be0913
parent 817194 00b874a4337ff8e0a820896b2096a74510e5820e
child 817196 d3fafe12ac682bc53b3ee2efe7833b1c39f919c1
push id115979
push userbmo:dglastonbury@mozilla.com
push dateThu, 12 Jul 2018 06:16:43 +0000
reviewersbirtles
bugs1467622
milestone63.0a1
Bug 1467622 - P2: Change SMIL paced tests to represent new distance calc. r?birtles Changing to Stylo for animation of color with currentColor. Stylo uses a different distance metric for numeric colors to currentColor. The result is that a different pacing is used in the fill case. MozReview-Commit-ID: 5x8c3IF5owV
dom/smil/test/db_smilCSSPaced.js
--- a/dom/smil/test/db_smilCSSPaced.js
+++ b/dom/smil/test/db_smilCSSPaced.js
@@ -23,37 +23,53 @@ var _pacedTestLists =
                           "rgb(20, 10, 8); " +
                           "rgb(20, 30, 4)",
                           { comp0:   "rgb(10, 10, 10)",
                             comp1_6: "rgb(15, 10, 9)",
                             comp1_3: "rgb(20, 10, 8)",
                             comp2_3: "rgb(20, 20, 6)",
                             comp1:   "rgb(20, 30, 4)"
                           }),
-    new AnimTestcasePaced("olive; " +        // rgb(128, 128, 0)
-                          "currentColor; " + // rgb(50, 50, 50)
-                          "rgb(206, 150, 206)",
-                          { comp0:   "rgb(128, 128, 0)",
-                            comp1_6: "rgb(89, 89, 25)",
-                            comp1_3: "rgb(50, 50, 50)",
-                            comp2_3: "rgb(128, 100, 128)",
-                            comp1:   "rgb(206, 150, 206)"
-                          }),
                           // Use the same RGB component values to make
                           // premultication effect easier to compute.
     new AnimTestcasePaced("rgba(20, 40, 60, 0.2); " +
                           "rgba(20, 40, 60, 0.4); " +
                           "rgba(20, 40, 60, 0.8)",
                           { comp0: "rgba(20, 40, 60, 0.2)",
                             comp1_6: "rgba(20, 40, 60, 0.3)",
                             comp1_3: "rgba(20, 40, 60, 0.4)",
                             comp2_3: "rgba(20, 40, 60, 0.6)",
                             comp1:   "rgba(20, 40, 60, 0.8)"
                           }),
   ],
+  currentColor_color: [
+    new AnimTestcasePaced("olive; " +        // rgb(128, 128, 0)
+                          "currentColor; " + // rgb(50, 50, 50)
+                          "rgb(206, 150, 206)",
+                          { comp0:   "rgb(128, 128, 0)",
+                            comp1_6: "rgb(89, 89, 25)",
+                            comp1_3: "rgb(50, 50, 50)",
+                            comp2_3: "rgb(128, 100, 128)",
+                            comp1:   "rgb(206, 150, 206)"
+                          }),
+  ],
+  currentColor_fill: [
+                          // Bug 1467622 changed the distance calculation
+                          // involving currentColor, comp values below
+                          // are no longer evenly spaced.
+    new AnimTestcasePaced("olive; " +        // rgb(128, 128, 0)
+                          "currentColor; " + // rgb(50, 50, 50)
+                          "rgb(206, 150, 206)",
+                          { comp0:   "rgb(128, 128, 0)",
+                            comp1_6: "rgb(99, 99, 18)",
+                            comp1_3: "rgb(71, 71, 37)",
+                            comp2_3: "rgb(111, 89, 111)",
+                            comp1:   "rgb(206, 150, 206)"
+                          }),
+  ],
   paintServer : [
     // Sanity check: These aren't interpolatable -- they should end up
     // ignoring the calcMode="paced" and falling into discrete-mode.
     new AnimTestcasePaced("url(#gradA); url(#gradB)",
           {
             comp0:   "url(\"" + document.URL + "#gradA\") rgb(0, 0, 0)",
             comp1_6: "url(\"" + document.URL + "#gradA\") rgb(0, 0, 0)",
             comp1_3: "url(\"" + document.URL + "#gradA\") rgb(0, 0, 0)",
@@ -205,22 +221,25 @@ var _pacedTestLists =
                           }),
   ],
 };
 
 // TODO: test more properties here.
 var gPacedBundles =
 [
   new TestcaseBundle(gPropList.clip,  _pacedTestLists.rect),
-  new TestcaseBundle(gPropList.color, _pacedTestLists.color),
+  new TestcaseBundle(gPropList.color,
+                     [].concat(_pacedTestLists.color,
+                               _pacedTestLists.currentColor_color)),
   new TestcaseBundle(gPropList.direction, [
     new AnimTestcasePaced("rtl; ltr; rtl")
   ]),
   new TestcaseBundle(gPropList.fill,
                      [].concat(_pacedTestLists.color,
+                               _pacedTestLists.currentColor_fill,
                                _pacedTestLists.paintServer)),
   new TestcaseBundle(gPropList.font_size,
                      [].concat(_pacedTestLists.lengthNoUnits,
                                _pacedTestLists.lengthPx, [
     new AnimTestcasePaced("20%; 24%; 16%",
                           { comp0:   "10px",
                             comp1_6: "11px",
                             comp1_3: "12px",