Bug 1387946 - Set/reset transition-property to cancel/create transition properly. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 16 Aug 2017 09:14:18 +0900
changeset 647089 decada76ac0aaee3af087c291031052a7fc5312f
parent 647088 0149c32ca8b798b586f763878abc4905f31adac7
child 726397 995056f2b050b24a458cb9047b490026e04c9196
push id74288
push userhikezoe@mozilla.com
push dateWed, 16 Aug 2017 00:19:57 +0000
reviewersbirtles
bugs1387946
milestone57.0a1
Bug 1387946 - Set/reset transition-property to cancel/create transition properly. r?birtles These test cases rely on the behavior that different lengths repeated list can not be transitioned on Gecko. But it's not clear the behavior is reasonable or not. The test cases here should not depend on the behavior. MozReview-Commit-ID: 19vI0TFMzfN
layout/style/test/test_transitions_per_property.html
--- a/layout/style/test/test_transitions_per_property.html
+++ b/layout/style/test/test_transitions_per_property.html
@@ -58,24 +58,16 @@ function any_unit_to_num(str)
 var FUNC_NEGATIVE = "cubic-bezier(0.25, -2, 0.75, 1)";
 var FUNC_OVERONE = "cubic-bezier(0.25, 0, 0.75, 3)";
 
 // After resolving Bug 1387080, we can remove this variable.
 const isServo = SpecialPowers.DOMWindowUtils.isStyledByServo;
 
 // The following properties will be skipped while using Servo backend.
 var skippedProperties = {
-    "background-position": true,    // Bug 1387946
-    "background-position-x": true,  // Bug 1387946
-    "background-position-y": true,  // Bug 1387946
-    "background-size": true,        // Bug 1387946
-    "mask-position": true,          // Bug 1387946
-    "mask-position-x": true,        // Bug 1387946
-    "mask-position-y": true,        // Bug 1387946
-    "mask-size": true,              // Bug 1387946
     "box-shadow": true,             // Bug 1387973
     "stroke-dasharray": true,       // Bug 1387986
     "stroke-dashoffset": true,      // Bug 1369614
     "stroke-width": true,           // Bug 1369614
     "text-shadow": true,            // Bug 1387973
 };
 
 var supported_properties = {
@@ -2333,46 +2325,57 @@ function test_background_position_coord_
   div.style.setProperty("transition-property", prop, "");
   div.style.setProperty(prop, "calc(40px + 20%)", "");
   is(cs.getPropertyValue(prop), "calc(-5px + 80%)",
      "property " + prop + ": interpolation of edge keywords w/ offsets & calc");
   check_distance(prop, `${endEdge} 20px`,
                        "calc(-5px + 80%)",
                        "calc(40px + 20%)");
 
+  div.style.setProperty("transition-property", "none", "");
   div.style.setProperty(prop, "10px, 50px, 30px", "");
   is(cs.getPropertyValue(prop), "10px, 50px, 30px",
      "property " + prop + ": computed value before transition");
+  div.style.setProperty("transition-property", prop, "");
   div.style.setProperty(prop, "50px, 70px, 30px", "");
   is(cs.getPropertyValue(prop), "20px, 55px, 30px",
      "property " + prop + ": interpolation of lists of lengths");
   check_distance(prop, "10px, 50px, 30px",
                        "20px, 55px, 30px",
                        "50px, 70px, 30px");
+
+  div.style.setProperty("transition-property", "none", "");
   div.style.setProperty(prop, "10px, 50%, 30%, 5px", "");
   is(cs.getPropertyValue(prop), "10px, 50%, 30%, 5px",
      "property " + prop + ": computed value before transition");
+  div.style.setProperty("transition-property", prop, "");
   div.style.setProperty(prop, "50px, 70%, 30%, 25px", "");
   is(cs.getPropertyValue(prop), "20px, 55%, 30%, 10px",
      "property " + prop + ": interpolation of lists of lengths and percents");
   check_distance(prop, "10px, 50%, 30%, 5px",
                        "20px, 55%, 30%, 10px",
                        "50px, 70%, 30%, 25px");
+
+  div.style.setProperty("transition-property", "none", "");
   div.style.setProperty(prop, "20%, 8px", "");
   is(cs.getPropertyValue(prop), "20%, 8px",
      "property " + prop + ": computed value before transition");
+  div.style.setProperty("transition-property", prop, "");
   div.style.setProperty(prop, "12px, 40%", "");
   is(cs.getPropertyValue(prop), "calc(3px + 15%), calc(6px + 10%)",
      "property " + prop + ": interpolation that computes to calc()");
   check_distance(prop, "20%, 8px",
                        "calc(3px + 15%), calc(6px + 10%)",
                        "12px, 40%");
+
+  div.style.setProperty("transition-property", "none", "");
   div.style.setProperty(prop, "calc(20% + 40px), 8px, calc(20px + 12%)", "");
   is(cs.getPropertyValue(prop), "calc(40px + 20%), 8px, calc(20px + 12%)",
      "property " + prop + ": computed value before transition");
+  div.style.setProperty("transition-property", prop, "");
   div.style.setProperty(prop, "12px, calc(20%), calc(8px + 20%)", "");
   is(cs.getPropertyValue(prop), "calc(33px + 15%), calc(6px + 5%), calc(17px + 14%)",
      "property " + prop + ": interpolation that computes to calc()");
   check_distance(prop, "calc(20% + 40px), 8px, calc(20px + 12%)",
                        "calc(33px + 15%), calc(6px + 5%), calc(17px + 14%)",
                        "12px, calc(20%), calc(8px + 20%)");
 }
 
@@ -2467,52 +2470,60 @@ function test_background_position_size_c
   if (doesPropHaveDistanceComputation) {
     check_distance(prop, "calc(40px + 10%) 16px",
                          "calc(30px + 15%) calc(14px + 15%)",
                          "30% calc(8px + 60%)");
   }
 
   // Test list values, if appropriate
   if (doesPropTakeListValues) {
+    div.style.setProperty("transition-property", "none", "");
     div.style.setProperty(prop, "10px 40px, 50px 50px, 30px 20px", "");
     is(cs.getPropertyValue(prop), "10px 40px, 50px 50px, 30px 20px",
        "property " + prop + ": computed value before transition");
+    div.style.setProperty("transition-property", prop, "");
     div.style.setProperty(prop, "50px 20px, 70px 50px, 30px 40px", "");
     is(cs.getPropertyValue(prop), "20px 35px, 55px 50px, 30px 25px",
        "property " + prop + ": interpolation of lists of lengths");
     if (doesPropHaveDistanceComputation) {
       check_distance(prop, "10px 40px, 50px 50px, 30px 20px",
                            "20px 35px, 55px 50px, 30px 25px",
                            "50px 20px, 70px 50px, 30px 40px");
     }
+    div.style.setProperty("transition-property", "none", "");
     div.style.setProperty(prop, "10px 40%, 50% 50px, 30% 20%, 5px 10px", "");
     is(cs.getPropertyValue(prop), "10px 40%, 50% 50px, 30% 20%, 5px 10px",
        "property " + prop + ": computed value before transition");
+    div.style.setProperty("transition-property", prop, "");
     div.style.setProperty(prop, "50px 20%, 70% 50px, 30% 40%, 25px 50px", "");
     is(cs.getPropertyValue(prop), "20px 35%, 55% 50px, 30% 25%, 10px 20px",
        "property " + prop + ": interpolation of lists of lengths and percents");
     if (doesPropHaveDistanceComputation) {
       check_distance(prop, "10px 40%, 50% 50px, 30% 20%, 5px 10px",
                            "20px 35%, 55% 50px, 30% 25%, 10px 20px",
                            "50px 20%, 70% 50px, 30% 40%, 25px 50px");
     }
+    div.style.setProperty("transition-property", "none", "");
     div.style.setProperty(prop, "20% 40%, 8px 12px", "");
     is(cs.getPropertyValue(prop), "20% 40%, 8px 12px",
        "property " + prop + ": computed value before transition");
+    div.style.setProperty("transition-property", prop, "");
     div.style.setProperty(prop, "12px 20px, 40% 16%", "");
     is(cs.getPropertyValue(prop), "calc(3px + 15%) calc(5px + 30%), calc(6px + 10%) calc(9px + 4%)",
        "property " + prop + ": interpolation that computes to calc()");
     if (doesPropHaveDistanceComputation) {
       check_distance(prop, "20% 40%, 8px 12px",
                            "calc(3px + 15%) calc(5px + 30%), calc(6px + 10%) calc(9px + 4%)",
                            "12px 20px, 40% 16%");
     }
+    div.style.setProperty("transition-property", "none", "");
     div.style.setProperty(prop, "calc(20% + 40px) calc(40px + 40%), 8px 12%, calc(20px + 12%) calc(24px + 8%)", "");
     is(cs.getPropertyValue(prop), "calc(40px + 20%) calc(40px + 40%), 8px 12%, calc(20px + 12%) calc(24px + 8%)",
        "property " + prop + ": computed value before transition");
+    div.style.setProperty("transition-property", prop, "");
     div.style.setProperty(prop, "12px 20%, calc(20%) calc(16px + 60%), calc(8px + 20%) calc(40px + 16%)", "");
     is(cs.getPropertyValue(prop), "calc(33px + 15%) calc(30px + 35%), calc(6px + 5%) calc(4px + 24%), calc(17px + 14%) calc(28px + 10%)",
        "property " + prop + ": interpolation that computes to calc()");
     if (doesPropHaveDistanceComputation) {
       check_distance(prop, "calc(20% + 40px) calc(40px + 40%), 8px 12%, calc(20px + 12%) calc(24px + 8%)",
                            "calc(33px + 15%) calc(30px + 35%), calc(6px + 5%) calc(4px + 24%), calc(17px + 14%) calc(28px + 10%)",
                            "12px 20%, calc(20%) calc(16px + 60%), calc(8px + 20%) calc(40px + 16%)");
     }