Bug 759568 - Part 4. mochitest for background-clip:text; draft
authorCJKu <cku@mozilla.com>
Tue, 12 Apr 2016 00:19:45 +0800
changeset 349450 b66a58fe270deceb48ba0528711f008adc685728
parent 349449 5873616e0f648ce7cdd8c9071d47fd8840106848
child 349451 62d7d64fecf498107886fdab7d854a3267109b77
push id15089
push usercku@mozilla.com
push dateMon, 11 Apr 2016 16:21:20 +0000
bugs759568
milestone48.0a1
Bug 759568 - Part 4. mochitest for background-clip:text; MozReview-Commit-ID: HH65Ev2XKSH
layout/style/test/property_database.js
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2224,16 +2224,19 @@ 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 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 +7390,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" ]
   };
 }
 
+var bg_clip_text_values = [
+  "text",
+  "content-box, text",
+  "text, border-box",
+  "text, text"
+];
+
+var bg_text_values = [
+  "url(404.png) green padding-box text",
+  "content-box text url(404.png) blue"
+];
+
+if (IsCSSPropertyPrefEnabled("layout.css.background-clip-text.enabled")) {
+  gCSSProperties["background-clip"].other_values =
+    gCSSProperties["background-clip"].other_values.concat(bg_clip_text_values);
+  gCSSProperties["background"].other_values =
+    gCSSProperties["background"].other_values.concat(bg_text_values);
+} else {
+  gCSSProperties["background-clip"].invalid_values =
+    gCSSProperties["background-clip"].invalid_values.concat(bg_clip_text_values);
+  gCSSProperties["background"].invalid_values =
+    gCSSProperties["background"].invalid_values.concat(bg_text_values);
+}
+
 // 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 + "', " +