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 720515 fcd4d2a747f7f4f8126f0f84a118d80329d09f7c
parent 720514 2d0485a6bd8b46f4f8f0c5302a2278898c45abd8
child 720516 5c413b59c19ddaa102a5ed52e8c1907e3b06747a
push id95568
push userbmo:cku@mozilla.com
push dateMon, 15 Jan 2018 18:26:38 +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",