Bug 1207734 - Part 9.a. (testing) Update gCSSProperties for the properties of individual transforms. draft
authorcku <cku@mozilla.com>
Mon, 11 Dec 2017 22:18:50 +0800
changeset 713517 ae6bf050a03ee6e16fb5718be5562cbf63e17954
parent 713516 2733f9b73ee49f027f630702487e386e5ff25802
child 713518 574526d962e37a48d4f785306141455a80a9ec5e
push id93657
push userbmo:cku@mozilla.com
push dateWed, 20 Dec 2017 14:03:45 +0000
bugs1207734
milestone59.0a1
Bug 1207734 - Part 9.a. (testing) Update gCSSProperties for the properties of individual transforms. MozReview-Commit-ID: GiQCo18M5da
layout/style/test/property_database.js
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6286,16 +6286,67 @@ function get_computed_value(cs, property
     }
     return results.join(" ; ");
   }
   if (info.get_computed)
     return info.get_computed(cs, property);
   return cs.getPropertyValue(property);
 }
 
+if (IsCSSPropertyPrefEnabled("layout.css.individual-transform.enabled")) {
+  gCSSProperties["rotate"] = {
+    domProp: "rotate",
+    inherited: false,
+    type: CSS_TYPE_LONGHAND,
+    initial_values: [ "none" ],
+    other_values: [ "45deg", "45grad", "72rad", "0.25turn", ".57rad",
+                    "0 0 0 0rad", "0 0 1 45deg", "0 0 1 0rad",
+                    /* valid calc() values */
+                    "calc(1) 0 0 calc(45deg + 5rad)",
+                    "0 1 0 calc(400grad + 1rad)",
+                    "calc(0.5turn + 10deg)"],
+    invalid_values: [ "0", "7", "0, 0, 1, 45deg", "0 0 45deg", "0 0 20rad",
+                      "0 0 0 0",
+                      /* invalid calc() values */
+                      "0.5 1 0 calc(45deg + 10)", "calc(0.5turn + 10%)", ],
+  };
+
+  gCSSProperties["translate"] = {
+    domProp: "translate",
+    inherited: false,
+    type: CSS_TYPE_LONGHAND,
+    initial_values: [ "none" ],
+    other_values: [ "-4px", "3px", "4em", "50%", "4px 5px 6px",
+                    "4px 5px", "50% 5px 6px", "50% 10% 6em",
+                    /* valid calc() values */
+                    "calc(5px + 10%)",
+                    "calc(0.25 * 5px + 10% / 3)",
+                    "calc(5px - 10% * 3)",
+                    "calc(5px - 3 * 10%) 50px",
+                    "-50px calc(5px - 10% * 3)",],
+    invalid_values: [ "1", "-moz-min(5px,10%)", "4px, 5px, 6px",
+                      "3px 4px 1px 7px", "4px 5px 10%",
+                      /* invalid calc() values */
+                      "10px calc(min(5px,10%))",
+                      "calc(max(5px,10%) 10%", "calc(nonsense)",],
+  };
+  gCSSProperties["scale"] = {
+    domProp: "scale",
+    inherited: false,
+    type: CSS_TYPE_LONGHAND,
+    initial_values: [ "none" ],
+    other_values: [ "10", "10 20", "10 20 30", "0 2.0",
+                     /* valid calc() values */
+                     "calc(1 + 2)", "calc(10) calc(20) 30"],
+    invalid_values: ["150%", "10px", "10deg", "10, 20, 30",
+                      /* invalid calc() values */
+                      "calc(1 + 20%)",  "10 calc(1 + 10px)"],
+  };
+}
+
 if (IsCSSPropertyPrefEnabled("layout.css.touch_action.enabled")) {
     gCSSProperties["touch-action"] = {
         domProp: "touchAction",
         inherited: false,
         type: CSS_TYPE_LONGHAND,
         initial_values: ["auto"],
         other_values: ["none", "pan-x", "pan-y", "pan-x pan-y", "pan-y pan-x", "manipulation"],
         invalid_values: ["zoom", "pinch", "tap", "10px", "2", "auto pan-x", "pan-x auto", "none pan-x", "pan-x none",