Bug 1530247 - Turn the Servo serialization property whitelist into a blacklist. r=boris
☠☠ backed out by 987a62667969 ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 24 Feb 2019 19:32:28 -0800
changeset 460978 c6ab8d3dd19a82d6202a3ef30b2aee3693ef0689
parent 460977 43862dc87e0bebd357c300843bc9f2f3eeb0ae41
child 460979 12aedb95583ab3177a70816eacfd43bd9aa89b4e
push id35613
push usernerli@mozilla.com
push dateTue, 26 Feb 2019 03:52:35 +0000
treeherdermozilla-central@faec87a80ed1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1530247
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 1530247 - Turn the Servo serialization property whitelist into a blacklist. r=boris It's easier to see what remains that way. Done with the following script: ``` execfile("layout/style/ServoCSSPropList.py") for p in data: if p.type() != "longhand": continue if "GetCSNeedsLayoutFlush" in p.flags or "SerializedByServo" in p.flags or "Internal" in p.flags: continue print(p.name) ``` Ran like: ``` $ python print.py | sort ``` From the objdir. Differential Revision: https://phabricator.services.mozilla.com/D20965
layout/style/ServoCSSPropList.mako.py
--- a/layout/style/ServoCSSPropList.mako.py
+++ b/layout/style/ServoCSSPropList.mako.py
@@ -55,120 +55,119 @@ def is_internal(prop):
 
 def method(prop):
     if prop.name == "float":
         return "CssFloat"
     if prop.name.startswith("-x-"):
         return prop.camel_case[1:]
     return prop.camel_case
 
-# Colors, integers and lengths are easy as well.
-#
-# TODO(emilio): This will go away once the rest of the longhands have been
-# moved or perhaps using a blacklist for the ones with non-layout-dependence
-# but other non-trivial dependence like scrollbar colors.
-SERIALIZED_PREDEFINED_TYPES = [
-    "Appearance",
-    "AlignContent",
-    "AlignItems",
-    "AlignSelf",
-    "BackgroundRepeat",
-    "BackgroundSize",
-    "BorderImageRepeat",
-    "BorderStyle",
-    "BreakBetween",
-    "BreakWithin",
-    "Clear",
-    "ClipRectOrAuto",
-    "Color",
-    "Content",
-    "CounterIncrement",
-    "CounterReset",
-    "Cursor",
-    "FillRule",
-    "Float",
-    "FontFamily",
-    "FontFeatureSettings",
-    "FontLanguageOverride",
-    "FontSize",
-    "FontSizeAdjust",
-    "FontStretch",
-    "FontStyle",
-    "FontSynthesis",
-    "FontVariant",
-    "FontVariantAlternates",
-    "FontVariantEastAsian",
-    "FontVariantLigatures",
-    "FontVariantNumeric",
-    "FontVariationSettings",
-    "FontWeight",
-    "Integer",
-    "ImageLayer",
-    "JustifyContent",
-    "JustifyItems",
-    "JustifySelf",
-    "Length",
-    "LengthPercentage",
-    "NonNegativeLength",
-    "NonNegativeLengthPercentage",
-    "NonNegativeLengthPercentageOrAuto",
-    "ListStyleType",
-    "OffsetPath",
-    "Opacity",
-    "OutlineStyle",
-    "OverflowWrap",
-    "Position",
-    "Quotes",
-    "Resize",
-    "Rotate",
-    "Scale",
-    "TextAlign",
-    "Translate",
-    "TimingFunction",
-    "TransformOrigin",
-    "TransformStyle",
-    "UserSelect",
-    "background::BackgroundSize",
-    "basic_shape::ClippingShape",
-    "basic_shape::FloatAreaShape",
-    "position::HorizontalPosition",
-    "position::VerticalPosition",
-    "url::ImageUrlOrNone",
-    "Appearance",
-    "OverscrollBehavior",
-    "OverflowAnchor",
-    "OverflowClipBox",
-    "ScrollSnapAlign",
-    "ScrollSnapType",
-    "Float",
-    "Overflow",
-    "BorderImageSlice",
-    "NonNegativeLengthOrNumberRect",
-    "NonNegativeLengthOrNumber",
-    "ZIndex",
-    "Perspective",
+# TODO(emilio): Get this to zero.
+LONGHANDS_NOT_SERIALIZED_WITH_SERVO = [
+    "animation-delay",
+    "animation-duration",
+    "animation-iteration-count",
+    "animation-name",
+    "border-bottom-left-radius",
+    "border-bottom-right-radius",
+    "border-end-end-radius",
+    "border-end-start-radius",
+    "border-image-width",
+    "border-spacing",
+    "border-start-end-radius",
+    "border-start-start-radius",
+    "border-top-left-radius",
+    "border-top-right-radius",
+    "border-image-width",
+    "border-spacing",
+    "box-shadow",
+    "caret-color",
+    "color",
+    "column-count",
+    "column-gap",
+    "column-rule-width",
+    "column-width",
+    "contain",
+    "display",
+    "fill",
+    "fill-opacity",
+    "filter",
+    "flex-basis",
+    "flex-grow",
+    "flex-shrink",
+    "grid-auto-columns",
+    "grid-auto-flow",
+    "grid-auto-rows",
+    "grid-column-end",
+    "grid-column-start",
+    "grid-row-end",
+    "grid-row-start",
+    "grid-template-areas",
+    "initial-letter",
+    "letter-spacing",
+    "marker-end",
+    "marker-mid",
+    "marker-start",
+    "max-block-size",
+    "max-height",
+    "max-inline-size",
+    "max-width",
+    "min-block-size",
+    "min-height",
+    "min-inline-size",
+    "min-width",
+    "-moz-binding",
+    "-moz-box-flex",
+    "-moz-force-broken-image-icon",
+    "-moz-osx-font-smoothing",
+    "-moz-outline-radius-bottomleft",
+    "-moz-outline-radius-bottomright",
+    "-moz-outline-radius-topleft",
+    "-moz-outline-radius-topright",
+    "outline-width",
+    "paint-order",
+    "row-gap",
+    "scrollbar-color",
+    "scroll-snap-points-x",
+    "scroll-snap-points-y",
+    "stroke",
+    "stroke-dasharray",
+    "stroke-dashoffset",
+    "stroke-miterlimit",
+    "stroke-opacity",
+    "stroke-width",
+    "text-decoration-line",
+    "text-emphasis-position",
+    "text-emphasis-style",
+    "text-overflow",
+    "text-shadow",
+    "touch-action",
+    "transition-delay",
+    "transition-duration",
+    "transition-property",
+    "vertical-align",
+    "-webkit-text-stroke-width",
+    "will-change",
+    "word-spacing",
 ]
 
 def serialized_by_servo(prop):
     # If the property requires layout information, no such luck.
     if "GETCS_NEEDS_LAYOUT_FLUSH" in prop.flags:
         return False
     if prop.type() == "shorthand":
         # FIXME: Need to serialize a value interpolated with currentcolor
         # properly to be able to use text-decoration, and figure out what to do
         # with relative mask urls.
         return prop.name != "text-decoration" and prop.name != "mask"
     # Keywords are all fine, except -moz-osx-font-smoothing, which does
     # resistfingerprinting stuff.
     if prop.keyword and prop.name != "-moz-osx-font-smoothing":
         return True
-    if prop.predefined_type in SERIALIZED_PREDEFINED_TYPES:
-        return True
-    # TODO(emilio): Enable the rest of the longhands.
-    return False
+    return prop.name not in LONGHANDS_NOT_SERIALIZED_WITH_SERVO
 
 def exposed_on_getcs(prop):
     if prop.type() == "longhand":
         return not is_internal(prop)
     # TODO: bug 137688 / https://github.com/w3c/csswg-drafts/issues/2529
     if prop.type() == "shorthand":
         return "SHORTHAND_IN_GETCS" in prop.flags