Bug 1215702 patch 1 - Remove the CSS properties that use CSS_PROP_BACKENDONLY (marks, orphans, page, size, widows), i.e., properties that were added in early Gecko days but never actually implemented. r=heycam
authorL. David Baron <dbaron@dbaron.org>
Mon, 19 Oct 2015 22:22:34 -0700
changeset 303652 d206c48d9e64ed1677bf2faaa50b1e1f902c9ded
parent 303651 0f7b2519fd1a9323e04223f10b4370ff18648e1d
child 303653 eabe8e45ac29ed67e8a719639dfcce0f4c0c91f7
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1215702
milestone44.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 1215702 patch 1 - Remove the CSS properties that use CSS_PROP_BACKENDONLY (marks, orphans, page, size, widows), i.e., properties that were added in early Gecko days but never actually implemented. r=heycam We're violating http://www.w3.org/TR/CSS/#partial by leaving this implementation in when we don't actually support the properties. We're also incorrectly parsing marks and size in style rules rather than @page rules; they were only intended for @page rules.
layout/style/nsCSSParser.cpp
layout/style/nsCSSPropList.h
layout/style/nsCSSValue.cpp
layout/style/test/property_database.js
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -954,25 +954,23 @@ protected:
   bool ParseFamily(nsCSSValue& aValue);
   bool ParseFontFeatureSettings(nsCSSValue& aValue);
   bool ParseFontSrc(nsCSSValue& aValue);
   bool ParseFontSrcFormat(InfallibleTArray<nsCSSValue>& values);
   bool ParseFontRanges(nsCSSValue& aValue);
   bool ParseListStyle();
   bool ParseListStyleType(nsCSSValue& aValue);
   bool ParseMargin();
-  bool ParseMarks(nsCSSValue& aValue);
   bool ParseClipPath();
   bool ParseTransform(bool aIsPrefixed);
   bool ParseObjectPosition();
   bool ParseOutline();
   bool ParseOverflow();
   bool ParsePadding();
   bool ParseQuotes();
-  bool ParseSize();
   bool ParseTextAlign(nsCSSValue& aValue,
                       const KTableValue aTable[]);
   bool ParseTextAlign(nsCSSValue& aValue);
   bool ParseTextAlignLast(nsCSSValue& aValue);
   bool ParseTextDecoration();
   bool ParseTextDecorationLine(nsCSSValue& aValue);
   bool ParseTextCombineUpright(nsCSSValue& aValue);
   bool ParseTextOverflow(nsCSSValue& aValue);
@@ -10434,18 +10432,16 @@ CSSParserImpl::ParsePropertyByFunction(n
   case eCSSProperty_outline:
     return ParseOutline();
   case eCSSProperty_overflow:
     return ParseOverflow();
   case eCSSProperty_padding:
     return ParsePadding();
   case eCSSProperty_quotes:
     return ParseQuotes();
-  case eCSSProperty_size:
-    return ParseSize();
   case eCSSProperty_text_decoration:
     return ParseTextDecoration();
   case eCSSProperty_will_change:
     return ParseWillChange();
   case eCSSProperty_transform:
     return ParseTransform(false);
   case eCSSProperty__moz_transform:
     return ParseTransform(true);
@@ -10542,18 +10538,16 @@ CSSParserImpl::ParseSingleValuePropertyB
     case eCSSProperty_font_feature_settings:
       return ParseFontFeatureSettings(aValue);
     case eCSSProperty_font_weight:
       return ParseFontWeight(aValue);
     case eCSSProperty_image_orientation:
       return ParseImageOrientation(aValue);
     case eCSSProperty_list_style_type:
       return ParseListStyleType(aValue);
-    case eCSSProperty_marks:
-      return ParseMarks(aValue);
     case eCSSProperty_scroll_snap_points_x:
       return ParseScrollSnapPoints(aValue, eCSSProperty_scroll_snap_points_x);
     case eCSSProperty_scroll_snap_points_y:
       return ParseScrollSnapPoints(aValue, eCSSProperty_scroll_snap_points_y);
     case eCSSProperty_scroll_snap_destination:
       return ParseScrollSnapDestination(aValue);
     case eCSSProperty_scroll_snap_coordinate:
       return ParseScrollSnapCoordinate(aValue);
@@ -13568,41 +13562,16 @@ CSSParserImpl::ParseMargin()
     eCSSProperty_margin_bottom,
     eCSSProperty_margin_left
   };
 
   return ParseBoxProperties(kMarginSideIDs);
 }
 
 bool
-CSSParserImpl::ParseMarks(nsCSSValue& aValue)
-{
-  if (ParseSingleTokenVariant(aValue, VARIANT_HK,
-                              nsCSSProps::kPageMarksKTable)) {
-    if (eCSSUnit_Enumerated == aValue.GetUnit()) {
-      if (NS_STYLE_PAGE_MARKS_NONE != aValue.GetIntValue() &&
-          false == CheckEndProperty()) {
-        nsCSSValue second;
-        if (ParseEnum(second, nsCSSProps::kPageMarksKTable)) {
-          // 'none' keyword in conjuction with others is not allowed
-          if (NS_STYLE_PAGE_MARKS_NONE != second.GetIntValue()) {
-            aValue.SetIntValue(aValue.GetIntValue() | second.GetIntValue(),
-                               eCSSUnit_Enumerated);
-            return true;
-          }
-        }
-        return false;
-      }
-    }
-    return true;
-  }
-  return false;
-}
-
-bool
 CSSParserImpl::ParseObjectPosition()
 {
   nsCSSValue value;
   if (!ParseSingleTokenVariant(value, VARIANT_INHERIT, nullptr) &&
       !ParsePositionValue(value)) {
     return false;
   }
   AppendValue(eCSSProperty_object_position, value);
@@ -13707,38 +13676,16 @@ CSSParserImpl::ParseQuotes()
       quotes = quotes->mNext;
     }
   }
   AppendValue(eCSSProperty_quotes, value);
   return true;
 }
 
 bool
-CSSParserImpl::ParseSize()
-{
-  nsCSSValue width, height;
-  if (!ParseSingleTokenVariant(width, VARIANT_AHKL,
-                               nsCSSProps::kPageSizeKTable)) {
-    return false;
-  }
-  if (width.IsLengthUnit()) {
-    ParseSingleTokenVariant(height, VARIANT_LENGTH, nullptr);
-  }
-
-  if (width == height || height.GetUnit() == eCSSUnit_Null) {
-    AppendValue(eCSSProperty_size, width);
-  } else {
-    nsCSSValue pair;
-    pair.SetPairValue(width, height);
-    AppendValue(eCSSProperty_size, pair);
-  }
-  return true;
-}
-
-bool
 CSSParserImpl::ParseTextDecoration()
 {
   static const nsCSSProperty kTextDecorationIDs[] = {
     eCSSProperty_text_decoration_line,
     eCSSProperty_text_decoration_style,
     eCSSProperty_text_decoration_color
   };
   const int32_t numProps = MOZ_ARRAY_LENGTH(kTextDecorationIDs);
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -2404,25 +2404,16 @@ CSS_PROP_CONTENT(
     marker_offset,
     MarkerOffset,
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_AHL | VARIANT_CALC,
     nullptr,
     offsetof(nsStyleContent, mMarkerOffset),
     eStyleAnimType_Coord)
-CSS_PROP_BACKENDONLY(
-    marks,
-    marks,
-    Marks,
-    CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
-    "",
-    0,
-    kPageMarksKTable)
 CSS_PROP_LOGICAL(
     max-block-size,
     max_block_size,
     MaxBlockSize,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
         CSS_PROPERTY_STORES_CALC |
         CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
@@ -2693,25 +2684,16 @@ CSS_PROP_DISPLAY(
     orient,
     CSS_PROP_DOMPROP_PREFIXED(Orient),
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kOrientKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
-CSS_PROP_BACKENDONLY(
-    orphans,
-    orphans,
-    Orphans,
-    CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
-    "",
-    VARIANT_HI,
-    nullptr)
 CSS_PROP_SHORTHAND(
     outline,
     outline,
     Outline,
     CSS_PROPERTY_PARSE_FUNCTION,
     "")
 CSS_PROP_OUTLINE(
     outline-color,
@@ -2949,24 +2931,16 @@ CSS_PROP_PADDING(
         CSS_PROPERTY_STORES_CALC |
         CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
         CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
     "",
     VARIANT_HLP | VARIANT_CALC,
     nullptr,
     offsetof(nsStylePadding, mPadding),
     eStyleAnimType_Sides_Top)
-CSS_PROP_BACKENDONLY(
-    page,
-    page,
-    Page,
-    CSS_PROPERTY_PARSE_VALUE,
-    "",
-    VARIANT_AUTO | VARIANT_IDENTIFIER,
-    nullptr)
 CSS_PROP_DISPLAY(
     page-break-after,
     page_break_after,
     PageBreakAfter,
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kPageBreakKTable,
@@ -3162,24 +3136,16 @@ CSS_PROP_DISPLAY(
     scroll_snap_type_y,
     ScrollSnapTypeY,
     CSS_PROPERTY_PARSE_VALUE,
     "layout.css.scroll-snap.enabled",
     VARIANT_HK,
     kScrollSnapTypeKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
-CSS_PROP_BACKENDONLY(
-    size,
-    size,
-    Size,
-    CSS_PROPERTY_PARSE_FUNCTION,
-    "",
-    0,
-    kPageSizeKTable)
 CSS_PROP_TABLE(
     table-layout,
     table_layout,
     TableLayout,
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kTableLayoutKTable,
@@ -3590,25 +3556,16 @@ CSS_PROP_TEXT(
     CSS_PROPERTY_PARSE_VALUE |
         // This is required by the UA stylesheet and can't be overridden.
         CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
     "",
     VARIANT_HK,
     kWhitespaceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
-CSS_PROP_BACKENDONLY(
-    widows,
-    widows,
-    Widows,
-    CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
-    "",
-    VARIANT_HI,
-    nullptr)
 CSS_PROP_POSITION(
     width,
     width,
     Width,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
         CSS_PROPERTY_STORES_CALC |
         CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -1212,28 +1212,16 @@ nsCSSValue::AppendToString(nsCSSProperty
         nsStyleUtil::AppendBitmaskCSSValue(
           aProperty, intValue,
           NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE,
           NS_STYLE_TEXT_DECORATION_LINE_PREF_ANCHORS,
           aResult);
       }
       break;
 
-    case eCSSProperty_marks:
-      if (intValue == NS_STYLE_PAGE_MARKS_NONE) {
-        AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue),
-                           aResult);
-      } else {
-        nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue,
-                                           NS_STYLE_PAGE_MARKS_CROP,
-                                           NS_STYLE_PAGE_MARKS_REGISTER,
-                                           aResult);
-      }
-      break;
-
     case eCSSProperty_paint_order:
       static_assert
         (NS_STYLE_PAINT_ORDER_BITWIDTH * NS_STYLE_PAINT_ORDER_LAST_VALUE <= 8,
          "SVGStyleStruct::mPaintOrder and the following cast not big enough");
       nsStyleUtil::AppendPaintOrderValue(static_cast<uint8_t>(GetIntValue()),
                                          aResult);
       break;
 
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2996,26 +2996,16 @@ var gCSSProperties = {
   "marker-offset": {
     domProp: "markerOffset",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
     other_values: [ "6em", "-1px", "calc(0px)", "calc(3em + 2px - 4px)", "calc(-2em)" ],
     invalid_values: []
   },
-  "marks": {
-    /* XXX not a real property; applies only to page context */
-    domProp: "marks",
-    inherited: false,
-    backend_only: true,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "none" ],
-    other_values: [ "crop", "cross", "crop cross", "cross crop" ],
-    invalid_values: [ "none none", "crop none", "none crop", "cross none", "none cross" ]
-  },
   "max-height": {
     domProp: "maxHeight",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     prerequisites: { "display": "block" },
     initial_values: [ "none",
       // these four keywords compute to the initial value when the
       // writing mode is horizontal, and that's the context we're testing in
@@ -3107,26 +3097,16 @@ var gCSSProperties = {
   "-moz-orient": {
     domProp: "MozOrient",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "inline" ],
     other_values: [ "horizontal", "vertical", "block" ],
     invalid_values: [ "none" ]
   },
-  "orphans": {
-    domProp: "orphans",
-    inherited: true,
-    backend_only: true,
-    type: CSS_TYPE_LONGHAND,
-    // XXX requires display:block
-    initial_values: [ "2" ],
-    other_values: [ "1", "7" ],
-    invalid_values: [ "0", "-1", "0px", "3px", "3e1" ]
-  },
   "outline": {
     domProp: "outline",
     inherited: false,
     type: CSS_TYPE_TRUE_SHORTHAND,
     subproperties: [ "outline-color", "outline-style", "outline-width" ],
     initial_values: [
       "none", "medium", "thin",
       // XXX Should be invert, but currently currentcolor.
@@ -3274,25 +3254,16 @@ var gCSSProperties = {
       "calc(50%)",
       "calc(3*25px)",
       "calc(25px*3)",
       "calc(3*25px + 50%)",
     ],
     invalid_values: [ ],
     quirks_values: { "5": "5px" },
   },
-  "page": {
-    domProp: "page",
-    inherited: true,
-    backend_only: true,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "auto" ],
-    other_values: [ "foo", "bar" ],
-    invalid_values: [ "3px" ]
-  },
   "page-break-after": {
     domProp: "pageBreakAfter",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
     other_values: [ "always", "avoid", "left", "right" ],
     invalid_values: []
   },
@@ -3352,29 +3323,16 @@ var gCSSProperties = {
       "calc(50%)",
       "calc(3*25px)",
       "calc(25px*3)",
       "calc(3*25px + 50%)",
     ],
     invalid_values: [],
     quirks_values: { "5": "5px" },
   },
-  "size": {
-    /* XXX not a real property; applies only to page context */
-    domProp: "size",
-    inherited: false,
-    backend_only: true,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "auto" ],
-    other_values: [ "landscape", "portrait", "8.5in 11in", "14in 11in", "297mm 210mm", "21cm 29.7cm", "100mm" ],
-    invalid_values: [
-      // XXX spec unclear on 0s and negatives
-      "100mm 100mm 100mm"
-    ]
-  },
   "table-layout": {
     domProp: "tableLayout",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
     other_values: [ "fixed" ],
     invalid_values: []
   },
@@ -3580,26 +3538,16 @@ var gCSSProperties = {
   "white-space": {
     domProp: "whiteSpace",
     inherited: true,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "normal" ],
     other_values: [ "pre", "nowrap", "pre-wrap", "pre-line", "-moz-pre-space" ],
     invalid_values: []
   },
-  "widows": {
-    domProp: "widows",
-    inherited: true,
-    backend_only: true,
-    type: CSS_TYPE_LONGHAND,
-    // XXX requires display:block
-    initial_values: [ "2" ],
-    other_values: [ "1", "7" ],
-    invalid_values: [ "0", "-1", "0px", "3px", "3e1" ]
-  },
   "width": {
     domProp: "width",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     /* computed value tests for width test more with display:block */
     prerequisites: { "display": "block" },
     initial_values: [ " auto" ],
     /* XXX these have prerequisites */