Bug 759568 - Part 4. mochitest for background-clip:text; r=heycom
authorCJKu <cku@mozilla.com>
Thu, 14 Apr 2016 16:28:07 +0800
changeset 331119 3b022b5f27475daff60dc0e6b171a93fa359bd40
parent 331118 cd594b3e98c11da6aa1c315183706c1977d5ddad
child 331120 a1d45ed2cb6388405977e6b3c5ad09eaab78f7c4
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycom
bugs759568
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 759568 - Part 4. mochitest for background-clip:text; r=heycom MozReview-Commit-ID: 8DrBq8nNWfu
layout/inspector/tests/test_bug877690.html
layout/style/test/property_database.js
--- a/layout/inspector/tests/test_bug877690.html
+++ b/layout/inspector/tests/test_bug877690.html
@@ -89,17 +89,17 @@ function do_test() {
       "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
       "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod",
       "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum",
       "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown",
       "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey",
       "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise",
       "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen", "no-repeat", "repeat",
       "repeat-x", "repeat-y", "fixed", "scroll", "local", "center", "top", "bottom", "left", "right",
-      "border-box", "padding-box", "content-box", "border-box", "padding-box", "content-box", "contain",
+      "border-box", "padding-box", "content-box", "border-box", "padding-box", "content-box", "text", "contain",
       "cover", "rgb", "hsl", "rgba", "hsla", "none", "-moz-element", "-moz-image-rect", "url", "linear-gradient",
       "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", "-moz-linear-gradient",
       "-moz-radial-gradient", "-moz-repeating-linear-gradient", "-moz-repeating-radial-gradient" ];
   ok(testValues(values, expected), "Shorthand property values.");
 
   var prop = "border";
   var values = getCSSValuesForProperty(prop);
   var expected = [ "-moz-calc", "initial", "unset", "-moz-use-text-color", "aliceblue",
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2224,16 +2224,20 @@ var gCSSProperties = {
       /* clip and origin separated in the shorthand */
       "url(404.png) padding-box green border-box",
       "url(404.png) padding-box green padding-box",
       "transparent padding-box url(404.png) border-box",
       "transparent padding-box url(404.png) padding-box",
       /* error inside functions */
       "-moz-image-rect(url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==), rubbish, 50%, 30%, 0) transparent",
       "-moz-element(#a rubbish) black",
+      "text",
+      "text border-box",
+      "content-box text text",
+      "padding-box text url(404.png) text",
     ]
   },
   "background-attachment": {
     domProp: "backgroundAttachment",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "scroll" ],
     other_values: [ "fixed", "local", "scroll,scroll", "fixed, scroll", "scroll, fixed, local, scroll", "fixed, fixed" ],
@@ -7387,16 +7391,40 @@ if (IsCSSPropertyPrefEnabled("layout.css
                     "filled dot", "filled circle", "filled double-circle", "filled triangle", "filled sesame",
                     "dot filled", "circle filled", "double-circle filled", "triangle filled", "sesame filled",
                     "dot open", "circle open", "double-circle open", "triangle open", "sesame open" ],
     invalid_values: [ "rubbish", "dot rubbish", "rubbish dot", "open rubbish", "rubbish open", "open filled", "dot circle",
                       "open '#'", "'#' filled", "dot '#'", "'#' circle", "1", "1 open", "open 1" ]
   };
 }
 
+if (IsCSSPropertyPrefEnabled("layout.css.background-clip-text.enabled")) {
+  gCSSProperties["background-clip"].other_values.push(
+    "text",
+    "content-box, text",
+    "text, border-box",
+    "text, text"
+  );
+  gCSSProperties["background"].other_values.push(
+    "url(404.png) green padding-box text",
+    "content-box text url(404.png) blue"
+  );
+} else {
+  gCSSProperties["background-clip"].invalid_values.push(
+    "text",
+    "content-box, text",
+    "text, border-box",
+    "text, text"
+  );
+  gCSSProperties["background"].invalid_values.push(
+    "url(404.png) green padding-box text",
+    "content-box text url(404.png) blue"
+  );
+}
+
 // Copy aliased properties' fields from their alias targets.
 for (var prop in gCSSProperties) {
   var entry = gCSSProperties[prop];
   if (entry.alias_for) {
     var aliasTargetEntry = gCSSProperties[entry.alias_for];
     if (!aliasTargetEntry) {
       ok(false,
          "Alias '" + prop + "' alias_for field, '" + entry.alias_for + "', " +