Bug 1532833: Use servo code to serialize CSS 'contain' property. r=emilio
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 06 Mar 2019 16:50:05 +0000
changeset 520582 6551636084e0652d785f4f9ff277cbe83bdf8cd7
parent 520581 3898fa37cfda0fa56faea0217b5b1a4b23e5ce8f
child 520583 d34db0a033145601b8ec344c9debd10799c2fdae
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1532833
milestone67.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 1532833: Use servo code to serialize CSS 'contain' property. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D22260
layout/style/ServoCSSPropList.mako.py
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
--- a/layout/style/ServoCSSPropList.mako.py
+++ b/layout/style/ServoCSSPropList.mako.py
@@ -72,17 +72,16 @@ LONGHANDS_NOT_SERIALIZED_WITH_SERVO = [
     "border-spacing",
     "box-shadow",
     "caret-color",
     "color",
     "column-count",
     "column-gap",
     "column-rule-width",
     "column-width",
-    "contain",
     "display",
     "fill",
     "filter",
     "flex-basis",
     "flex-grow",
     "flex-shrink",
     "grid-auto-columns",
     "grid-auto-flow",
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -342,25 +342,16 @@ const KTableEntry nsCSSProps::kGridTrack
     {eCSSKeyword_max_content, StyleGridTrackBreadth::MaxContent},
     {eCSSKeyword_UNKNOWN, -1}};
 
 const KTableEntry nsCSSProps::kLineHeightKTable[] = {
     // -moz- prefixed, intended for internal use for single-line controls
     {eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT},
     {eCSSKeyword_UNKNOWN, -1}};
 
-const KTableEntry nsCSSProps::kContainKTable[] = {
-    {eCSSKeyword_none, NS_STYLE_CONTAIN_NONE},
-    {eCSSKeyword_strict, NS_STYLE_CONTAIN_STRICT},
-    {eCSSKeyword_content, NS_STYLE_CONTAIN_CONTENT},
-    {eCSSKeyword_layout, NS_STYLE_CONTAIN_LAYOUT},
-    {eCSSKeyword_paint, NS_STYLE_CONTAIN_PAINT},
-    {eCSSKeyword_size, NS_STYLE_CONTAIN_SIZE},
-    {eCSSKeyword_UNKNOWN, -1}};
-
 const KTableEntry nsCSSProps::kTextAlignKTable[] = {
     {eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT},
     {eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT},
     {eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER},
     {eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY},
     {eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER},
     {eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT},
     {eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT},
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -300,17 +300,16 @@ class nsCSSProps {
   static const KTableEntry kAutoCompletionAlignItems[];
   static const KTableEntry kAutoCompletionAlignJustifyContent[];
   // ------------------------------------------------------------------
   // clang-format on
   static const KTableEntry kFontSmoothingKTable[];
   static const KTableEntry kGridAutoFlowKTable[];
   static const KTableEntry kGridTrackBreadthKTable[];
   static const KTableEntry kLineHeightKTable[];
-  static const KTableEntry kContainKTable[];
   static const KTableEntry kTextAlignKTable[];
   static const KTableEntry kTextDecorationLineKTable[];
   static const KTableEntry kTextDecorationStyleKTable[];
   static const KTableEntry kTextEmphasisStyleShapeKTable[];
   static const KTableEntry kTextOverflowKTable[];
   static const KTableEntry kTouchActionKTable[];
   static const KTableEntry kVerticalAlignKTable[];
 };
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -2238,44 +2238,16 @@ already_AddRefed<CSSValue> nsComputedDOM
 
 already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetDisplay() {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mDisplay,
                                                nsCSSProps::kDisplayKTable));
   return val.forget();
 }
 
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetContain() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-
-  int32_t mask = StyleDisplay()->mContain;
-
-  if (mask == 0) {
-    val->SetIdent(eCSSKeyword_none);
-  } else if (mask & NS_STYLE_CONTAIN_STRICT) {
-    NS_ASSERTION(
-        mask == (NS_STYLE_CONTAIN_STRICT | NS_STYLE_CONTAIN_ALL_BITS),
-        "contain: strict should imply contain: size layout style paint");
-    val->SetIdent(eCSSKeyword_strict);
-  } else if (mask & NS_STYLE_CONTAIN_CONTENT) {
-    NS_ASSERTION(
-        mask == (NS_STYLE_CONTAIN_CONTENT | NS_STYLE_CONTAIN_CONTENT_BITS),
-        "contain: content should imply contain: layout style paint");
-    val->SetIdent(eCSSKeyword_content);
-  } else {
-    nsAutoString valueStr;
-    nsStyleUtil::AppendBitmaskCSSValue(nsCSSProps::kContainKTable, mask,
-                                       NS_STYLE_CONTAIN_SIZE,
-                                       NS_STYLE_CONTAIN_PAINT, valueStr);
-    val->SetString(valueStr);
-  }
-
-  return val.forget();
-}
-
 already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetWillChange() {
   const nsTArray<RefPtr<nsAtom>>& willChange = StyleDisplay()->mWillChange;
 
   if (willChange.IsEmpty()) {
     RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
     val->SetIdent(eCSSKeyword_auto);
     return val.forget();
   }
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -313,17 +313,16 @@ class nsComputedDOMStyle final : public 
   already_AddRefed<CSSValue> DoGetTextEmphasisStyle();
   already_AddRefed<CSSValue> DoGetTextOverflow();
   already_AddRefed<CSSValue> DoGetTextShadow();
   already_AddRefed<CSSValue> DoGetWebkitTextStrokeWidth();
 
   /* Display properties */
   already_AddRefed<CSSValue> DoGetBinding();
   already_AddRefed<CSSValue> DoGetDisplay();
-  already_AddRefed<CSSValue> DoGetContain();
   already_AddRefed<CSSValue> DoGetWillChange();
   already_AddRefed<CSSValue> DoGetTouchAction();
   already_AddRefed<CSSValue> DoGetTransform();
   already_AddRefed<CSSValue> DoGetTransformOrigin();
   already_AddRefed<CSSValue> DoGetPerspectiveOrigin();
   already_AddRefed<CSSValue> DoGetScrollSnapPointsX();
   already_AddRefed<CSSValue> DoGetScrollSnapPointsY();
   already_AddRefed<CSSValue> DoGetScrollbarColor();