Bug 1301638 : Part 3 - Add invalid values for mask longhand. draft
authorAstley Chen <aschen@mozilla.com>
Fri, 04 Nov 2016 15:56:51 +0800
changeset 433760 92474d8ee8b78f6e1c7f68aeb5951cc9d9e7a272
parent 433759 854000f8097e0ef101a601f188c3f7a53063e034
child 535946 e7fdc2f9b6c46d7157f07fa40ff8f0cb5f52a22b
push id34640
push useraschen@mozilla.com
push dateFri, 04 Nov 2016 07:57:51 +0000
bugs1301638
milestone52.0a1
Bug 1301638 : Part 3 - Add invalid values for mask longhand. MozReview-Commit-ID: 6nnEBfRRkaY
layout/style/test/property_database.js
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -7004,22 +7004,17 @@ if (IsCSSPropertyPrefEnabled("layout.css
     domProp: "scrollSnapTypeY",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "none" ],
     other_values: ["mandatory", "proximity"],
     invalid_values: [ "auto",  "1px" ]
   };
 }
-
-function SupportsMaskShorthand() {
-  return "maskImage" in document.documentElement.style;
-}
-
-if (SupportsMaskShorthand()) {
+if (IsCSSPropertyPrefEnabled("layout.css.positioned-mask.enabled")) {
   gCSSProperties["mask"] = {
     domProp: "mask",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     /* FIXME: All mask-border-* should be added when we implement them. */
     subproperties: ["mask-clip", "mask-image", "mask-mode", "mask-origin", "mask-position-x", "mask-position-y", "mask-repeat", "mask-size" , "mask-composite"],
     initial_values: [ "match-source", "none", "no-repeat", "add", "50% 50%", "center center", "50% 50% / auto", "center / auto", "center center / auto", "50% 50% / auto auto",
       "center none", "center center none", "none center", "none center center", "none 50% 50%", "center / auto none",
@@ -7275,24 +7270,37 @@ if (SupportsMaskShorthand()) {
       "calc(20px) calc(20px)",
       "calc(20px + 1em) calc(20px / 2)",
       "calc(20px + 50%) calc(50% - 10px)",
       "calc(-20px) calc(-50%)",
       "calc(-20%) calc(-50%)"
     ],
     invalid_values: [ "contain contain", "cover cover", "cover auto", "auto cover", "contain cover", "cover contain", "-5px 3px", "3px -5px", "auto -5px", "-5px auto", "5 3", "10px calc(10px + rubbish)" ]
   };
-} else {
+} else { /* mask longhand */
   gCSSProperties["mask"] = {
     domProp: "mask",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "none" ],
     other_values: [ "url(#mymask)" ],
-    invalid_values: []
+    invalid_values: [
+      "none repeat-y alpha add 50% 50%",
+      "subtract",
+      "50% center subtract alpha no-repeat none",
+      "top",
+      "left",
+      "0% 0%",
+      "top left",
+      "center / 100px",
+      "center / contain",
+      "center / cover",
+      "10px / 10%",
+      "10em / calc(20px)"
+    ]
   };
 }
 
 if (IsCSSPropertyPrefEnabled("layout.css.prefixes.webkit")) {
   gCSSProperties["-webkit-animation"] = {
     domProp: "webkitAnimation",
     inherited: false,
     type: CSS_TYPE_TRUE_SHORTHAND,
@@ -7688,17 +7696,17 @@ if (IsCSSPropertyPrefEnabled("layout.css
   gCSSProperties["-webkit-user-select"] = {
     domProp: "webkitUserSelect",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     alias_for: "-moz-user-select",
     subproperties: [ "-moz-user-select" ],
   };
 
-  if (SupportsMaskShorthand()) {
+  if (IsCSSPropertyPrefEnabled("layout.css.positioned-mask.enabled")) {
     gCSSProperties["-webkit-mask"] = {
       domProp: "webkitMask",
       inherited: false,
       type: CSS_TYPE_TRUE_SHORTHAND,
       alias_for: "mask",
       subproperties: [ "mask-clip", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size" , "mask-composite" ],
     };
     gCSSProperties["-webkit-mask-clip"] = {