Bug 1530247 - Turn the Servo serialization property whitelist into a blacklist. r=boris
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 24 Feb 2019 19:32:28 -0800
changeset 518914 4cf427da8ee6c418e6778cd51a6b1029dbcd9af8
parent 518913 9018a6cb05789db2a2f4a09eea3df881a289a37b
child 518915 68fd0947b767892a557ba92daba8d9895e3856c4
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)
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