Bug 1283679 - fix misspelled mask-composite:subtract keyword. r=dbaron
authorAstley Chen <aschen@mozilla.com>
Mon, 04 Jul 2016 11:17:13 +0800
changeset 303685 03ea4596d84203bf16fdf0d7fc003588c3e8a044
parent 303684 045e13e67ed43f96e9639a9fec9f8e8b45fd91ed
child 303686 f47a1bc057ff5a6084e776040425da258a2851ca
child 303742 adbe2cd1bf286e36e6dfc4c5f13b2a4a6e6600fd
push id79141
push usercbook@mozilla.com
push dateTue, 05 Jul 2016 14:07:42 +0000
treeherdermozilla-inbound@f08c54971dd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1283679
milestone50.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 1283679 - fix misspelled mask-composite:subtract keyword. r=dbaron MozReview-Commit-ID: 67UEtupOLoM
layout/base/nsCSSRendering.h
layout/reftests/w3c-css/submitted/masking/mask-composite-1a.html
layout/reftests/w3c-css/submitted/masking/mask-composite-1b.html
layout/reftests/w3c-css/submitted/masking/mask-composite-1c.html
layout/reftests/w3c-css/submitted/masking/mask-composite-2-ref.html
layout/reftests/w3c-css/submitted/masking/mask-composite-2a.html
layout/reftests/w3c-css/submitted/masking/mask-composite-2b.html
layout/reftests/w3c-css/submitted/masking/mask-composite-2c.html
layout/style/nsCSSKeywordList.h
layout/style/nsCSSProps.cpp
layout/style/nsStyleConsts.h
layout/style/test/property_database.js
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -790,23 +790,22 @@ struct nsCSSRendering {
       case NS_STYLE_BLEND_COLOR:       return CompositionOp::OP_COLOR;
       case NS_STYLE_BLEND_LUMINOSITY:  return CompositionOp::OP_LUMINOSITY;
       default:      MOZ_ASSERT(false); return CompositionOp::OP_OVER;
     }
   }
 
   static CompositionOp GetGFXCompositeMode(uint8_t aCompositeMode) {
     switch (aCompositeMode) {
-      case NS_STYLE_MASK_COMPOSITE_ADD:        return CompositionOp::OP_OVER;
-      case NS_STYLE_MASK_COMPOSITE_SUBSTRACT:  return CompositionOp::OP_OUT;
-      case NS_STYLE_MASK_COMPOSITE_INTERSECT:  return CompositionOp::OP_IN;
-      case NS_STYLE_MASK_COMPOSITE_EXCLUDE:    return CompositionOp::OP_XOR;
-      default:              MOZ_ASSERT(false); return CompositionOp::OP_OVER;
+      case NS_STYLE_MASK_COMPOSITE_ADD:       return CompositionOp::OP_OVER;
+      case NS_STYLE_MASK_COMPOSITE_SUBTRACT:  return CompositionOp::OP_OUT;
+      case NS_STYLE_MASK_COMPOSITE_INTERSECT: return CompositionOp::OP_IN;
+      case NS_STYLE_MASK_COMPOSITE_EXCLUDE:   return CompositionOp::OP_XOR;
+      default: MOZ_ASSERT(false);             return CompositionOp::OP_OVER;
     }
-
   }
 protected:
   static gfxRect GetTextDecorationRectInternal(
       const Point& aPt, const DecorationRectParams& aParams);
 
   /**
    * Returns inflated rect for painting a decoration line.
    * Complex style decoration lines should be painted from leftmost of nearest
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-1a.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-1a.html
@@ -21,31 +21,31 @@
                     url(support/blue-100x50-transparent-100x50.svg);
       }
 
       div.add {
         left: 10px;
         mask-composite: add;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
-        mask-composite: substract;
+        mask-composite: subtract;
       }
 
       div.intersect {
         left: 230px;
         mask-composite: intersect;
       }
 
       div.exclude {
         left: 340px;
         mask-composite: exclude;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="intersect"></div>
     <div class="exclude"></div>
   </body>
 </html>
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-1b.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-1b.html
@@ -21,31 +21,31 @@
                     url(support/blue-100x50-transparent-100x50.png);
       }
 
       div.add {
         left: 10px;
         mask-composite: add;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
-        mask-composite: substract;
+        mask-composite: subtract;
       }
 
       div.intersect {
         left: 230px;
         mask-composite: intersect;
       }
 
       div.exclude {
         left: 340px;
         mask-composite: exclude;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="intersect"></div>
     <div class="exclude"></div>
   </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-1c.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-1c.html
@@ -26,31 +26,31 @@
                     url(#rectMask);
       }
 
       div.add {
         left: 10px;
         mask-composite: add;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
-        mask-composite: substract;
+        mask-composite: subtract;
       }
 
       div.intersect {
         left: 230px;
         mask-composite: intersect;
       }
 
       div.exclude {
         left: 340px;
         mask-composite: exclude;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="intersect"></div>
     <div class="exclude"></div>
   </body>
 </html>
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-2-ref.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-2-ref.html
@@ -15,25 +15,25 @@
         top: 10px;
       }
 
       div.add {
         left: 10px;
         background-color: blue;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
         background-image: url(support/blue-100x50-transparent-100x50.svg);
       }
 
       div.exclude {
         left: 340px;
         background-color: blue;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="exclude"></div>
   </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-2a.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-2a.html
@@ -21,31 +21,31 @@
                     url(support/transparent-100x50-blue-100x50.svg);
       }
 
       div.add {
         left: 10px;
         mask-composite: add;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
-        mask-composite: substract;
+        mask-composite: subtract;
       }
 
       div.intersect {
         left: 230px;
         mask-composite: intersect;
       }
 
       div.exclude {
         left: 340px;
         mask-composite: exclude;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="intersect"></div>
     <div class="exclude"></div>
   </body>
 </html>
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-2b.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-2b.html
@@ -21,31 +21,31 @@
                     url(support/transparent-100x50-blue-100x50.png);
       }
 
       div.add {
         left: 10px;
         mask-composite: add;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
-        mask-composite: substract;
+        mask-composite: subtract;
       }
 
       div.intersect {
         left: 230px;
         mask-composite: intersect;
       }
 
       div.exclude {
         left: 340px;
         mask-composite: exclude;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="intersect"></div>
     <div class="exclude"></div>
   </body>
 </html>
\ No newline at end of file
--- a/layout/reftests/w3c-css/submitted/masking/mask-composite-2c.html
+++ b/layout/reftests/w3c-css/submitted/masking/mask-composite-2c.html
@@ -29,31 +29,31 @@
                     url(#rectMask2);
       }
 
       div.add {
         left: 10px;
         mask-composite: add;
       }
 
-      div.substract {
+      div.subtract {
         left: 120px;
-        mask-composite: substract;
+        mask-composite: subtract;
       }
 
       div.intersect {
         left: 230px;
         mask-composite: intersect;
       }
 
       div.exclude {
         left: 340px;
         mask-composite: exclude;
       }
     </style>
   </head>
   <body>
     <div class="add"></div>
-    <div class="substract"></div>
+    <div class="subtract"></div>
     <div class="intersect"></div>
     <div class="exclude"></div>
   </body>
 </html>
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -556,17 +556,17 @@ CSS_KEY(stretched, stretched)
 CSS_KEY(strict, strict)
 CSS_KEY(stroke, stroke)
 CSS_KEY(stroke-box, stroke_box)
 CSS_KEY(style, style)
 CSS_KEY(styleset, styleset)
 CSS_KEY(stylistic, stylistic)
 CSS_KEY(sub, sub)
 CSS_KEY(subgrid, subgrid)
-CSS_KEY(substract, substract)
+CSS_KEY(subtract, subtract)
 CSS_KEY(super, super)
 CSS_KEY(sw-resize, sw_resize)
 CSS_KEY(swash, swash)
 CSS_KEY(swap, swap)
 CSS_KEY(table, table)
 CSS_KEY(table-caption, table_caption)
 CSS_KEY(table-cell, table_cell)
 CSS_KEY(table-column, table_column)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -958,17 +958,17 @@ const KTableEntry nsCSSProps::kImageLaye
   { eCSSKeyword_alpha, NS_STYLE_MASK_MODE_ALPHA },
   { eCSSKeyword_luminance, NS_STYLE_MASK_MODE_LUMINANCE },
   { eCSSKeyword_match_source, NS_STYLE_MASK_MODE_MATCH_SOURCE },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kImageLayerCompositeKTable[] = {
   { eCSSKeyword_add, NS_STYLE_MASK_COMPOSITE_ADD },
-  { eCSSKeyword_substract, NS_STYLE_MASK_COMPOSITE_SUBSTRACT },
+  { eCSSKeyword_subtract, NS_STYLE_MASK_COMPOSITE_SUBTRACT },
   { eCSSKeyword_intersect, NS_STYLE_MASK_COMPOSITE_INTERSECT },
   { eCSSKeyword_exclude, NS_STYLE_MASK_COMPOSITE_EXCLUDE },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kBlendModeKTable[] = {
     { eCSSKeyword_normal,      NS_STYLE_BLEND_NORMAL },
     { eCSSKeyword_multiply,    NS_STYLE_BLEND_MULTIPLY },
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -1162,17 +1162,17 @@ enum class FillMode : uint32_t;
 #define NS_STYLE_BLEND_EXCLUSION                    11
 #define NS_STYLE_BLEND_HUE                          12
 #define NS_STYLE_BLEND_SATURATION                   13
 #define NS_STYLE_BLEND_COLOR                        14
 #define NS_STYLE_BLEND_LUMINOSITY                   15
 
 // composite
 #define NS_STYLE_MASK_COMPOSITE_ADD                 0
-#define NS_STYLE_MASK_COMPOSITE_SUBSTRACT           1
+#define NS_STYLE_MASK_COMPOSITE_SUBTRACT            1
 #define NS_STYLE_MASK_COMPOSITE_INTERSECT           2
 #define NS_STYLE_MASK_COMPOSITE_EXCLUDE             3
 
 // See nsStyleText::mControlCharacterVisibility
 #define NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN  0
 #define NS_STYLE_CONTROL_CHARACTER_VISIBILITY_VISIBLE 1
 
 // counter system
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6885,18 +6885,18 @@ if (SupportsMaskShorthand()) {
     other_values: [
       "none alpha repeat add left top",
       "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)",
       "repeat url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==') alpha left top add",
       "repeat-x",
       "repeat-y",
       "no-repeat",
       "none repeat-y alpha add 0% 0%",
-      "substract",
-      "0% top substract alpha repeat none",
+      "subtract",
+      "0% top subtract alpha repeat none",
       "top",
       "left",
       "50% 50%",
       "center",
       "top / 100px",
       "left / contain",
       "left / cover",
       "10px / 10%",
@@ -6913,19 +6913,19 @@ if (SupportsMaskShorthand()) {
       "-moz-radial-gradient(10% bottom, #ffffff, black) add no-repeat",
       "-moz-linear-gradient(10px 10px -45deg, red, blue) repeat",
       "-moz-linear-gradient(10px 10px -0.125turn, red, blue) repeat",
       "-moz-repeating-radial-gradient(10% bottom, #ffffff, black) add no-repeat",
       "-moz-repeating-linear-gradient(10px 10px -45deg, red, blue) repeat",
       "-moz-element(#test) alpha",
       /* multiple mask-image */
       "url(404.png), url(404.png)",
-      "repeat-x, substract, none",
+      "repeat-x, subtract, none",
       "0% top url(404.png), url(404.png) 0% top",
-      "substract repeat-y top left url(404.png), repeat-x alpha",
+      "subtract repeat-y top left url(404.png), repeat-x alpha",
       "url(404.png), -moz-linear-gradient(20px 20px -45deg, blue, green), -moz-element(#a) alpha",
       "top left / contain, bottom right / cover",
       /* test cases with clip+origin in the shorthand */
       "url(404.png) alpha padding-box",
       "url(404.png) border-box alpha",
       "content-box url(404.png)",
       "url(404.png) alpha padding-box padding-box",
       "url(404.png) alpha padding-box border-box",
@@ -6983,18 +6983,18 @@ if (SupportsMaskShorthand()) {
     other_values: [ "alpha", "luminance", "match-source, match-source", "match-source, alpha", "alpha, luminance, match-source"],
     invalid_values: [ "match-source match-source", "alpha match-source" ]
   };
   gCSSProperties["mask-composite"] = {
     domProp: "maskComposite",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "add" ],
-    other_values: [ "substract", "intersect", "exclude", "add, add", "substract, intersect", "substract, substract, add"],
-    invalid_values: [ "add substract", "intersect exclude" ]
+    other_values: [ "subtract", "intersect", "exclude", "add, add", "subtract, intersect", "subtract, subtract, add"],
+    invalid_values: [ "add subtract", "intersect exclude" ]
   };
   gCSSProperties["mask-origin"] = {
     domProp: "maskOrigin",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "border-box" ],
     other_values: [ "padding-box", "content-box", "border-box, padding-box", "padding-box, padding-box, padding-box", "border-box, border-box" ],
     invalid_values: [ "margin-box", "padding-box padding-box" ]