Bug 1471114 part 2 - Generate ComputedStyleMap entry list from property data. r?emilio draft
authorXidorn Quan <me@upsuper.org>
Tue, 26 Jun 2018 17:17:33 +1000
changeset 811141 879a7265c35f51c5954d8a44ccd374a606ecba0e
parent 810741 6e2448ce3f4d9965749298a575795dfab926b9cb
child 811142 82ce1f7b7fd21c406cf61726c78de5f120028e35
push id114203
push userxquan@mozilla.com
push dateWed, 27 Jun 2018 00:38:52 +0000
reviewersemilio
bugs1471114
milestone63.0a1
Bug 1471114 part 2 - Generate ComputedStyleMap entry list from property data. r?emilio This changes the order of properties returned from gCS. The old order doesn't make much sense, and other browsers don't agree on an identical order either, so it should be trivial to change it. Also the spec isn't super clear / useful in this case. Several -moz-prefixed properties are excluded from the list due to their being internal. I suspect they are never accessible anyway, so probably nothing gets changed by this. MozReview-Commit-ID: 9LfangjpJ3P
layout/style/GenerateComputedDOMStyleGenerated.py
layout/style/GenerateServoCSSPropList.py
layout/style/ServoCSSPropList.mako.py
layout/style/moz.build
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsComputedDOMStylePropertyList.h
layout/style/test/test_bug657143.html
servo/components/style/properties/properties.mako.rs
servo/components/style/properties/shorthands/background.mako.rs
servo/components/style/properties/shorthands/box.mako.rs
servo/components/style/properties/shorthands/font.mako.rs
servo/components/style/properties/shorthands/svg.mako.rs
servo/components/style/properties/shorthands/text.mako.rs
new file mode 100644
--- /dev/null
+++ b/layout/style/GenerateComputedDOMStyleGenerated.py
@@ -0,0 +1,52 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import runpy
+
+def generate(output, dataFile):
+    output.write("""/* THIS IS AN AUTOGENERATED FILE.  DO NOT EDIT */
+
+/* processed file that defines entries for nsComputedDOMStyle, designed
+   to be #included in nsComputedDOMStyle.cpp */
+
+static constexpr Entry kEntries[] = {
+""")
+
+    def exposed_on_getcs(p):
+        return "ExposedOnGetCS" in p.flags
+
+    def order_key(p):
+        # Put prefixed properties after normal properties.
+        # The spec is unclear about this, and Blink doesn't have any sensible
+        # order at all, so it probably doesn't matter a lot. But originally
+        # Gecko put then later so we do so as well. See w3c/csswg-drafts#2827.
+        order = p.name.startswith("-")
+        return (order, p.name)
+
+    # Some special cases we may get rid of later. See bug 1471423.
+    def method(p):
+        if p.id.startswith("margin_"):
+            return "{}Width".format(p.method)
+        if p.id == "ime_mode":
+            return "IMEMode"
+        if p.id == "float":
+            return "Float"
+        if p.id.startswith("_moz_"):
+            method = p.method[3:]
+        else:
+            method = p.method
+        if p.id.startswith("_moz_outline_radius_"):
+            method = method.replace("left", "Left")
+            method = method.replace("right", "Right")
+        return method
+
+    properties = runpy.run_path(dataFile)["data"]
+    properties = filter(exposed_on_getcs, properties)
+    properties.sort(key=order_key)
+
+    TEMPLATE = "  {{ eCSSProperty_{}, &nsComputedDOMStyle::DoGet{} }},\n"
+    for p in properties:
+        output.write(TEMPLATE.format(p.id, method(p)))
+
+    output.write("};\n")
--- a/layout/style/GenerateServoCSSPropList.py
+++ b/layout/style/GenerateServoCSSPropList.py
@@ -58,36 +58,40 @@ def generate_header(output, data):
 
 #ifndef CSS_PROP_ALIAS
 #define CSS_PROP_ALIAS(name_, aliasid_, id_, method_, pref_) /* nothing */
 #define DEFINED_CSS_PROP_ALIAS
 #endif
 
 """)
 
+    # Some flags are only used for code generation, so we don't need to
+    # expose them to runtime.
+    COMPILE_TIME_FLAGS = {"ExposedOnGetCS"}
+
     MACRO_NAMES = {
         "longhand": "CSS_PROP_LONGHAND",
         "shorthand": "CSS_PROP_SHORTHAND",
         "alias": "CSS_PROP_ALIAS",
     }
     for prop in data:
         is_internal = "Internal" in prop.flags
         pref = '"' + prop.pref + '"'
         if prop.type() == "alias":
             params = [prop.name, prop.alias_id, prop.prop_id, prop.method, pref]
         else:
             method = prop.method
             if method == "CssFloat":
                 method = "CSS_PROP_PUBLIC_OR_PRIVATE(CssFloat, Float)"
             elif method.startswith("Moz"):
                 method = "CSS_PROP_DOMPROP_PREFIXED({})".format(method[3:])
-            if prop.flags:
-                flags = " | ".join("CSSPropFlags::{}".format(flag)
-                                   for flag in prop.flags)
-            else:
+            flags = " | ".join("CSSPropFlags::{}".format(flag)
+                               for flag in prop.flags
+                               if flag not in COMPILE_TIME_FLAGS)
+            if not flags:
                 flags = "CSSPropFlags(0)"
             params = [prop.name, prop.id, method, flags, pref]
 
         if is_internal:
             output.write("#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL\n")
         output.write("{}({})\n".format(MACRO_NAMES[prop.type()], ", ".join(params)))
         if is_internal:
             output.write("#endif\n")
--- a/layout/style/ServoCSSPropList.mako.py
+++ b/layout/style/ServoCSSPropList.mako.py
@@ -91,31 +91,44 @@ def serialized_by_servo(prop):
     # 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
 
+def exposed_on_getcs(prop):
+    if prop.type() == "longhand":
+        if is_internal(prop):
+            return False
+        # We currently don't expose logical properties in GetCS.
+        # See bug 1116638.
+        if prop.logical:
+            return False
+        return True
+    if prop.type() == "shorthand":
+        return "SHORTHAND_IN_GETCS" in prop.flags
 
 def flags(prop):
     result = []
     if prop.explicitly_enabled_in_chrome():
         result.append("EnabledInUASheetsAndChrome")
     elif prop.explicitly_enabled_in_ua_sheets():
         result.append("EnabledInUASheets")
     if is_internal(prop):
         result.append("Internal")
     if prop.enabled_in == "":
         result.append("Inaccessible")
     if "GETCS_NEEDS_LAYOUT_FLUSH" in prop.flags:
         result.append("GetCSNeedsLayoutFlush")
     if "CAN_ANIMATE_ON_COMPOSITOR" in prop.flags:
         result.append("CanAnimateOnCompositor")
+    if exposed_on_getcs(prop):
+        result.append("ExposedOnGetCS")
     if serialized_by_servo(prop):
         result.append("SerializedByServo")
     return ", ".join('"{}"'.format(flag) for flag in result)
 
 def pref(prop):
     if prop.gecko_pref:
         return '"' + prop.gecko_pref + '"'
     return '""'
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -22,17 +22,16 @@ with Files('nsDOM*'):
 DIRS += ['xbl-marquee']
 TEST_DIRS += ['test']
 
 EXPORTS += [
     '!nsCSSPropertyID.h',
     'AnimationCommon.h',
     'CounterStyleManager.h',
     'nsAnimationManager.h',
-    'nsComputedDOMStylePropertyList.h',
     'nsCSSAnonBoxes.h',
     'nsCSSAnonBoxList.h',
     'nsCSSCounterDescList.h',
     'nsCSSFontDescList.h',
     'nsCSSKeywordList.h',
     'nsCSSKeywords.h',
     'nsCSSPropertyIDSet.h',
     'nsCSSProps.h',
@@ -269,19 +268,26 @@ servo_props.inputs = [
 servo_props = GENERATED_FILES['ServoCSSPropList.py']
 servo_props.script = 'GenerateServoCSSPropList.py:generate_data'
 servo_props.inputs = [
     'ServoCSSPropList.mako.py',
 ]
 
 if CONFIG['COMPILE_ENVIRONMENT']:
     GENERATED_FILES += [
+        'nsComputedDOMStyleGenerated.cpp',
         'nsCSSPropsGenerated.inc',
     ]
 
+    computed = GENERATED_FILES['nsComputedDOMStyleGenerated.cpp']
+    computed.script = 'GenerateComputedDOMStyleGenerated.py:generate'
+    computed.inputs = [
+        '!ServoCSSPropList.py',
+    ]
+
     css_props = GENERATED_FILES['nsCSSPropsGenerated.inc']
     css_props.script = 'GenerateCSSPropsGenerated.py:generate'
     css_props.inputs = [
         '!ServoCSSPropList.py',
     ]
 
     CONFIGURE_SUBST_FILES += [
         'bindgen.toml',
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -192,26 +192,19 @@ struct ComputedStyleMap
     }
 
     bool IsEnabled() const
     {
       return nsCSSProps::IsEnabled(mProperty, CSSEnabledState::eForAllContent);
     }
   };
 
-  // We define this enum just to count the total number of properties that can
-  // be exposed on an nsComputedDOMStyle, including properties that may be
-  // disabled.
-  enum {
-#define COMPUTED_STYLE_PROP(prop_, method_) \
-    eComputedStyleProperty_##prop_,
-#include "nsComputedDOMStylePropertyList.h"
-#undef COMPUTED_STYLE_PROP
-    eComputedStyleProperty_COUNT
-  };
+  // This generated file includes definition of kEntries which is typed
+  // Entry[] and used below, so this #include has to be put here.
+#include "nsComputedDOMStyleGenerated.cpp"
 
   /**
    * Returns the number of properties that should be exposed on an
    * nsComputedDOMStyle, ecxluding any disabled properties.
    */
   uint32_t Length()
   {
     Update();
@@ -252,32 +245,27 @@ struct ComputedStyleMap
    */
   void MarkDirty() { mExposedPropertyCount = 0; }
 
   // The member variables are public so that we can use an initializer in
   // nsComputedDOMStyle::GetComputedStyleMap.  Use the member functions
   // above to get information from this object.
 
   /**
-   * An entry for each property that can be exposed on an nsComputedDOMStyle.
-   */
-  const Entry kEntries[eComputedStyleProperty_COUNT];
-
-  /**
    * The number of properties that should be exposed on an nsComputedDOMStyle.
    * This will be less than eComputedStyleProperty_COUNT if some property
    * prefs are disabled.  A value of 0 indicates that it and mIndexMap are out
    * of date.
    */
   uint32_t mExposedPropertyCount;
 
   /**
    * A map of indexes on the nsComputedDOMStyle object to indexes into kEntries.
    */
-  uint32_t mIndexMap[eComputedStyleProperty_COUNT];
+  uint32_t mIndexMap[ArrayLength(kEntries)];
 
 private:
   /**
    * Returns whether mExposedPropertyCount and mIndexMap are out of date.
    */
   bool IsDirty() { return mExposedPropertyCount == 0; }
 
   /**
@@ -291,25 +279,28 @@ private:
    */
   uint32_t EntryIndex(uint32_t aIndex) const
   {
     MOZ_ASSERT(aIndex < mExposedPropertyCount);
     return mIndexMap[aIndex];
   }
 };
 
+constexpr ComputedStyleMap::Entry
+ComputedStyleMap::kEntries[ArrayLength(kEntries)];
+
 void
 ComputedStyleMap::Update()
 {
   if (!IsDirty()) {
     return;
   }
 
   uint32_t index = 0;
-  for (uint32_t i = 0; i < eComputedStyleProperty_COUNT; i++) {
+  for (uint32_t i = 0; i < ArrayLength(kEntries); i++) {
     if (kEntries[i].IsEnabled()) {
       mIndexMap[index++] = i;
     }
   }
   mExposedPropertyCount = index;
 }
 
 nsComputedDOMStyle::nsComputedDOMStyle(dom::Element* aElement,
@@ -7173,24 +7164,17 @@ nsComputedDOMStyle::ParentChainChanged(n
                "mResolvedComputedStyle is true");
 
   ClearComputedStyle();
 }
 
 /* static */ ComputedStyleMap*
 nsComputedDOMStyle::GetComputedStyleMap()
 {
-  static ComputedStyleMap map = {
-    {
-#define COMPUTED_STYLE_PROP(prop_, method_) \
-  { eCSSProperty_##prop_, &nsComputedDOMStyle::DoGet##method_ },
-#include "nsComputedDOMStylePropertyList.h"
-#undef COMPUTED_STYLE_PROP
-    }
-  };
+  static ComputedStyleMap map{};
   return &map;
 }
 
 /* static */ void
 nsComputedDOMStyle::RegisterPrefChangeCallbacks()
 {
   // Note that this will register callbacks for all properties with prefs, not
   // just those that are implemented on computed style objects, as it's not
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -775,16 +775,18 @@ private:
    * Whether we resolved a ComputedStyle last time we called
    * UpdateCurrentStyleSources.  Initially false.
    */
   bool mResolvedComputedStyle;
 
 #ifdef DEBUG
   bool mFlushedPendingReflows;
 #endif
+
+  friend struct ComputedStyleMap;
 };
 
 already_AddRefed<nsComputedDOMStyle>
 NS_NewComputedDOMStyle(mozilla::dom::Element* aElement,
                        const nsAString& aPseudoElt,
                        nsIDocument* aDocument,
                        nsComputedDOMStyle::StyleType aStyleType =
                          nsComputedDOMStyle::eAll);
deleted file mode 100644
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ /dev/null
@@ -1,375 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * a list of the CSS properties that are exposed on nsComputedDOMStyle
- * objects, for preprocessing
- */
-
-/******
-
-  This file contains the list of CSS properties that are exposed
-  on nsComputedDOMStyle objects.  It is designed to be included in
-  nsComputedDOMStyle.cpp to generate the "computed style map", a
-  table of property IDs and corresponding functions on nsComputedDOMStyle
-  that return the CSSValue representing that property's computed value.
-
-  The COMPUTED_STYLE_PROP macro is defined for each such property.
-  Its arguments are:
-
-  -. 'id' the nsCSSPropertyID ID, without the leading "nsCSSProperty_".
-
-  -. 'method' the nsComputedDOMStyle method name that returns the
-  CSSValue representing that property's computed value, without the leading
-  "Do".
-
- ******/
-
-/* ******************************************************************* *\
- * Properties below are listed in alphabetical order.                  *
- * Please keep them that way.                                          *
- *                                                                     *
- * Properties commented out with // are not yet implemented            *
- * Properties commented out with //// are shorthands and not queryable *
-\* ******************************************************************* */
-
-/* ***************************** *\
- * Implementations of CSS styles *
-\* ***************************** */
-
-COMPUTED_STYLE_PROP(align_content,                 AlignContent)
-COMPUTED_STYLE_PROP(align_items,                   AlignItems)
-COMPUTED_STYLE_PROP(align_self,                    AlignSelf)
-//// COMPUTED_STYLE_PROP(animation,                Animation)
-COMPUTED_STYLE_PROP(animation_delay,               AnimationDelay)
-COMPUTED_STYLE_PROP(animation_direction,           AnimationDirection)
-COMPUTED_STYLE_PROP(animation_duration,            AnimationDuration)
-COMPUTED_STYLE_PROP(animation_fill_mode,           AnimationFillMode)
-COMPUTED_STYLE_PROP(animation_iteration_count,     AnimationIterationCount)
-COMPUTED_STYLE_PROP(animation_name,                AnimationName)
-COMPUTED_STYLE_PROP(animation_play_state,          AnimationPlayState)
-COMPUTED_STYLE_PROP(animation_timing_function,     AnimationTimingFunction)
-COMPUTED_STYLE_PROP(backface_visibility,           BackfaceVisibility)
-//// COMPUTED_STYLE_PROP(background,               Background)
-COMPUTED_STYLE_PROP(background_attachment,         BackgroundAttachment)
-COMPUTED_STYLE_PROP(background_blend_mode,         BackgroundBlendMode)
-COMPUTED_STYLE_PROP(background_clip,               BackgroundClip)
-COMPUTED_STYLE_PROP(background_color,              BackgroundColor)
-COMPUTED_STYLE_PROP(background_image,              BackgroundImage)
-COMPUTED_STYLE_PROP(background_origin,             BackgroundOrigin)
-COMPUTED_STYLE_PROP(background_position,           BackgroundPosition)
-COMPUTED_STYLE_PROP(background_position_x,         BackgroundPositionX)
-COMPUTED_STYLE_PROP(background_position_y,         BackgroundPositionY)
-COMPUTED_STYLE_PROP(background_repeat,             BackgroundRepeat)
-COMPUTED_STYLE_PROP(background_size,               BackgroundSize)
-//// COMPUTED_STYLE_PROP(border,                   Border)
-//// COMPUTED_STYLE_PROP(border_bottom,            BorderBottom)
-COMPUTED_STYLE_PROP(border_bottom_color,           BorderBottomColor)
-COMPUTED_STYLE_PROP(border_bottom_left_radius,     BorderBottomLeftRadius)
-COMPUTED_STYLE_PROP(border_bottom_right_radius,    BorderBottomRightRadius)
-COMPUTED_STYLE_PROP(border_bottom_style,           BorderBottomStyle)
-COMPUTED_STYLE_PROP(border_bottom_width,           BorderBottomWidth)
-COMPUTED_STYLE_PROP(border_collapse,               BorderCollapse)
-//// COMPUTED_STYLE_PROP(border_color,             BorderColor)
-//// COMPUTED_STYLE_PROP(border_image,             BorderImage)
-COMPUTED_STYLE_PROP(border_image_outset,           BorderImageOutset)
-COMPUTED_STYLE_PROP(border_image_repeat,           BorderImageRepeat)
-COMPUTED_STYLE_PROP(border_image_slice,            BorderImageSlice)
-COMPUTED_STYLE_PROP(border_image_source,           BorderImageSource)
-COMPUTED_STYLE_PROP(border_image_width,            BorderImageWidth)
-//// COMPUTED_STYLE_PROP(border_left,              BorderLeft)
-COMPUTED_STYLE_PROP(border_left_color,             BorderLeftColor)
-COMPUTED_STYLE_PROP(border_left_style,             BorderLeftStyle)
-COMPUTED_STYLE_PROP(border_left_width,             BorderLeftWidth)
-//// COMPUTED_STYLE_PROP(border_right,             BorderRight)
-COMPUTED_STYLE_PROP(border_right_color,            BorderRightColor)
-COMPUTED_STYLE_PROP(border_right_style,            BorderRightStyle)
-COMPUTED_STYLE_PROP(border_right_width,            BorderRightWidth)
-COMPUTED_STYLE_PROP(border_spacing,                BorderSpacing)
-//// COMPUTED_STYLE_PROP(border_style,             BorderStyle)
-//// COMPUTED_STYLE_PROP(border_top,               BorderTop)
-COMPUTED_STYLE_PROP(border_top_color,              BorderTopColor)
-COMPUTED_STYLE_PROP(border_top_left_radius,        BorderTopLeftRadius)
-COMPUTED_STYLE_PROP(border_top_right_radius,       BorderTopRightRadius)
-COMPUTED_STYLE_PROP(border_top_style,              BorderTopStyle)
-COMPUTED_STYLE_PROP(border_top_width,              BorderTopWidth)
-//// COMPUTED_STYLE_PROP(border_width,             BorderWidth)
-COMPUTED_STYLE_PROP(bottom,                        Bottom)
-COMPUTED_STYLE_PROP(box_decoration_break,          BoxDecorationBreak)
-COMPUTED_STYLE_PROP(box_shadow,                    BoxShadow)
-COMPUTED_STYLE_PROP(box_sizing,                    BoxSizing)
-COMPUTED_STYLE_PROP(caption_side,                  CaptionSide)
-COMPUTED_STYLE_PROP(caret_color,                   CaretColor)
-COMPUTED_STYLE_PROP(clear,                         Clear)
-COMPUTED_STYLE_PROP(clip,                          Clip)
-COMPUTED_STYLE_PROP(color,                         Color)
-COMPUTED_STYLE_PROP(color_adjust,                  ColorAdjust)
-COMPUTED_STYLE_PROP(column_count,                  ColumnCount)
-COMPUTED_STYLE_PROP(column_fill,                   ColumnFill)
-COMPUTED_STYLE_PROP(column_gap,                    ColumnGap)
-//// COMPUTED_STYLE_PROP(column_rule,              ColumnRule)
-COMPUTED_STYLE_PROP(column_rule_color,             ColumnRuleColor)
-COMPUTED_STYLE_PROP(column_rule_style,             ColumnRuleStyle)
-COMPUTED_STYLE_PROP(column_rule_width,             ColumnRuleWidth)
-COMPUTED_STYLE_PROP(column_span,                   ColumnSpan)
-COMPUTED_STYLE_PROP(column_width,                  ColumnWidth)
-COMPUTED_STYLE_PROP(contain,                       Contain)
-COMPUTED_STYLE_PROP(content,                       Content)
-COMPUTED_STYLE_PROP(counter_increment,             CounterIncrement)
-COMPUTED_STYLE_PROP(counter_reset,                 CounterReset)
-COMPUTED_STYLE_PROP(cursor,                        Cursor)
-COMPUTED_STYLE_PROP(direction,                     Direction)
-COMPUTED_STYLE_PROP(display,                       Display)
-COMPUTED_STYLE_PROP(empty_cells,                   EmptyCells)
-COMPUTED_STYLE_PROP(flex_basis,                    FlexBasis)
-COMPUTED_STYLE_PROP(flex_direction,                FlexDirection)
-COMPUTED_STYLE_PROP(flex_grow,                     FlexGrow)
-COMPUTED_STYLE_PROP(flex_shrink,                   FlexShrink)
-COMPUTED_STYLE_PROP(flex_wrap,                     FlexWrap)
-COMPUTED_STYLE_PROP(float,                         Float)
-//// COMPUTED_STYLE_PROP(font,                     Font)
-COMPUTED_STYLE_PROP(font_family,                   FontFamily)
-COMPUTED_STYLE_PROP(font_feature_settings,         FontFeatureSettings)
-COMPUTED_STYLE_PROP(font_kerning,                  FontKerning)
-COMPUTED_STYLE_PROP(font_language_override,        FontLanguageOverride)
-COMPUTED_STYLE_PROP(font_optical_sizing,           FontOpticalSizing)
-COMPUTED_STYLE_PROP(font_size,                     FontSize)
-COMPUTED_STYLE_PROP(font_size_adjust,              FontSizeAdjust)
-COMPUTED_STYLE_PROP(font_stretch,                  FontStretch)
-COMPUTED_STYLE_PROP(font_style,                    FontStyle)
-COMPUTED_STYLE_PROP(font_synthesis,                FontSynthesis)
-COMPUTED_STYLE_PROP(font_variant,                  FontVariant)
-COMPUTED_STYLE_PROP(font_variant_alternates,       FontVariantAlternates)
-COMPUTED_STYLE_PROP(font_variant_caps,             FontVariantCaps)
-COMPUTED_STYLE_PROP(font_variant_east_asian,       FontVariantEastAsian)
-COMPUTED_STYLE_PROP(font_variant_ligatures,        FontVariantLigatures)
-COMPUTED_STYLE_PROP(font_variant_numeric,          FontVariantNumeric)
-COMPUTED_STYLE_PROP(font_variant_position,         FontVariantPosition)
-COMPUTED_STYLE_PROP(font_variation_settings,       FontVariationSettings)
-COMPUTED_STYLE_PROP(font_weight,                   FontWeight)
-COMPUTED_STYLE_PROP(grid_auto_columns,             GridAutoColumns)
-COMPUTED_STYLE_PROP(grid_auto_flow,                GridAutoFlow)
-COMPUTED_STYLE_PROP(grid_auto_rows,                GridAutoRows)
-COMPUTED_STYLE_PROP(grid_column_end,               GridColumnEnd)
-COMPUTED_STYLE_PROP(grid_column_start,             GridColumnStart)
-COMPUTED_STYLE_PROP(grid_row_end,                  GridRowEnd)
-COMPUTED_STYLE_PROP(grid_row_start,                GridRowStart)
-COMPUTED_STYLE_PROP(grid_template_areas,           GridTemplateAreas)
-COMPUTED_STYLE_PROP(grid_template_columns,         GridTemplateColumns)
-COMPUTED_STYLE_PROP(grid_template_rows,            GridTemplateRows)
-COMPUTED_STYLE_PROP(height,                        Height)
-COMPUTED_STYLE_PROP(hyphens,                       Hyphens)
-COMPUTED_STYLE_PROP(image_orientation,             ImageOrientation)
-COMPUTED_STYLE_PROP(ime_mode,                      IMEMode)
-COMPUTED_STYLE_PROP(initial_letter,                InitialLetter)
-COMPUTED_STYLE_PROP(isolation,                     Isolation)
-COMPUTED_STYLE_PROP(justify_content,               JustifyContent)
-COMPUTED_STYLE_PROP(justify_items,                 JustifyItems)
-COMPUTED_STYLE_PROP(justify_self,                  JustifySelf)
-COMPUTED_STYLE_PROP(left,                          Left)
-COMPUTED_STYLE_PROP(letter_spacing,                LetterSpacing)
-COMPUTED_STYLE_PROP(line_height,                   LineHeight)
-//// COMPUTED_STYLE_PROP(list_style,               ListStyle)
-COMPUTED_STYLE_PROP(list_style_image,              ListStyleImage)
-COMPUTED_STYLE_PROP(list_style_position,           ListStylePosition)
-COMPUTED_STYLE_PROP(list_style_type,               ListStyleType)
-//// COMPUTED_STYLE_PROP(margin,                   Margin)
-COMPUTED_STYLE_PROP(margin_bottom,                 MarginBottomWidth)
-COMPUTED_STYLE_PROP(margin_left,                   MarginLeftWidth)
-COMPUTED_STYLE_PROP(margin_right,                  MarginRightWidth)
-COMPUTED_STYLE_PROP(margin_top,                    MarginTopWidth)
-// COMPUTED_STYLE_PROP(marks,                      Marks)
-COMPUTED_STYLE_PROP(max_height,                    MaxHeight)
-COMPUTED_STYLE_PROP(max_width,                     MaxWidth)
-COMPUTED_STYLE_PROP(min_height,                    MinHeight)
-COMPUTED_STYLE_PROP(min_width,                     MinWidth)
-COMPUTED_STYLE_PROP(mix_blend_mode,                MixBlendMode)
-COMPUTED_STYLE_PROP(object_fit,                    ObjectFit)
-COMPUTED_STYLE_PROP(object_position,               ObjectPosition)
-COMPUTED_STYLE_PROP(opacity,                       Opacity)
-// COMPUTED_STYLE_PROP(orphans,                    Orphans)
-//// COMPUTED_STYLE_PROP(outline,                  Outline)
-COMPUTED_STYLE_PROP(order,                         Order)
-COMPUTED_STYLE_PROP(outline_color,                 OutlineColor)
-COMPUTED_STYLE_PROP(outline_offset,                OutlineOffset)
-COMPUTED_STYLE_PROP(outline_style,                 OutlineStyle)
-COMPUTED_STYLE_PROP(outline_width,                 OutlineWidth)
-COMPUTED_STYLE_PROP(overflow,                      Overflow)
-COMPUTED_STYLE_PROP(overflow_clip_box_block,       OverflowClipBoxBlock)
-COMPUTED_STYLE_PROP(overflow_clip_box_inline,      OverflowClipBoxInline)
-COMPUTED_STYLE_PROP(overflow_wrap,                 OverflowWrap)
-COMPUTED_STYLE_PROP(overflow_x,                    OverflowX)
-COMPUTED_STYLE_PROP(overflow_y,                    OverflowY)
-COMPUTED_STYLE_PROP(overscroll_behavior_x,         OverscrollBehaviorX)
-COMPUTED_STYLE_PROP(overscroll_behavior_y,         OverscrollBehaviorY)
-//// COMPUTED_STYLE_PROP(padding,                  Padding)
-COMPUTED_STYLE_PROP(padding_bottom,                PaddingBottom)
-COMPUTED_STYLE_PROP(padding_left,                  PaddingLeft)
-COMPUTED_STYLE_PROP(padding_right,                 PaddingRight)
-COMPUTED_STYLE_PROP(padding_top,                   PaddingTop)
-// COMPUTED_STYLE_PROP(page,                       Page)
-COMPUTED_STYLE_PROP(page_break_after,              PageBreakAfter)
-COMPUTED_STYLE_PROP(page_break_before,             PageBreakBefore)
-COMPUTED_STYLE_PROP(page_break_inside,             PageBreakInside)
-COMPUTED_STYLE_PROP(perspective,                   Perspective)
-COMPUTED_STYLE_PROP(perspective_origin,            PerspectiveOrigin)
-COMPUTED_STYLE_PROP(pointer_events,                PointerEvents)
-COMPUTED_STYLE_PROP(position,                      Position)
-COMPUTED_STYLE_PROP(quotes,                        Quotes)
-COMPUTED_STYLE_PROP(resize,                        Resize)
-COMPUTED_STYLE_PROP(right,                         Right)
-COMPUTED_STYLE_PROP(rotate,                        Rotate)
-COMPUTED_STYLE_PROP(row_gap,                       RowGap)
-COMPUTED_STYLE_PROP(ruby_align,                    RubyAlign)
-COMPUTED_STYLE_PROP(ruby_position,                 RubyPosition)
-COMPUTED_STYLE_PROP(scale,                         Scale)
-COMPUTED_STYLE_PROP(scroll_behavior,               ScrollBehavior)
-COMPUTED_STYLE_PROP(scroll_snap_coordinate,        ScrollSnapCoordinate)
-COMPUTED_STYLE_PROP(scroll_snap_destination,       ScrollSnapDestination)
-COMPUTED_STYLE_PROP(scroll_snap_points_x,          ScrollSnapPointsX)
-COMPUTED_STYLE_PROP(scroll_snap_points_y,          ScrollSnapPointsY)
-COMPUTED_STYLE_PROP(scroll_snap_type_x,            ScrollSnapTypeX)
-COMPUTED_STYLE_PROP(scroll_snap_type_y,            ScrollSnapTypeY)
-COMPUTED_STYLE_PROP(scrollbar_face_color,          ScrollbarFaceColor)
-COMPUTED_STYLE_PROP(scrollbar_track_color,         ScrollbarTrackColor)
-COMPUTED_STYLE_PROP(shape_image_threshold,         ShapeImageThreshold)
-COMPUTED_STYLE_PROP(shape_margin,                  ShapeMargin)
-COMPUTED_STYLE_PROP(shape_outside,                 ShapeOutside)
-//// COMPUTED_STYLE_PROP(size,                     Size)
-COMPUTED_STYLE_PROP(table_layout,                  TableLayout)
-COMPUTED_STYLE_PROP(text_align,                    TextAlign)
-COMPUTED_STYLE_PROP(text_align_last,               TextAlignLast)
-COMPUTED_STYLE_PROP(text_combine_upright,          TextCombineUpright)
-COMPUTED_STYLE_PROP(text_decoration,               TextDecoration)
-COMPUTED_STYLE_PROP(text_decoration_color,         TextDecorationColor)
-COMPUTED_STYLE_PROP(text_decoration_line,          TextDecorationLine)
-COMPUTED_STYLE_PROP(text_decoration_style,         TextDecorationStyle)
-//// COMPUTED_STYLE_PROP(text_emphasis,            TextEmphasis)
-COMPUTED_STYLE_PROP(text_emphasis_color,           TextEmphasisColor)
-COMPUTED_STYLE_PROP(text_emphasis_position,        TextEmphasisPosition)
-COMPUTED_STYLE_PROP(text_emphasis_style,           TextEmphasisStyle)
-COMPUTED_STYLE_PROP(text_indent,                   TextIndent)
-COMPUTED_STYLE_PROP(text_justify,                  TextJustify)
-COMPUTED_STYLE_PROP(text_orientation,              TextOrientation)
-COMPUTED_STYLE_PROP(text_overflow,                 TextOverflow)
-COMPUTED_STYLE_PROP(text_shadow,                   TextShadow)
-COMPUTED_STYLE_PROP(text_transform,                TextTransform)
-COMPUTED_STYLE_PROP(top,                           Top)
-COMPUTED_STYLE_PROP(touch_action,                  TouchAction)
-COMPUTED_STYLE_PROP(transform,                     Transform)
-COMPUTED_STYLE_PROP(transform_box,                 TransformBox)
-COMPUTED_STYLE_PROP(transform_origin,              TransformOrigin)
-COMPUTED_STYLE_PROP(transform_style,               TransformStyle)
-//// COMPUTED_STYLE_PROP(transition,               Transition)
-COMPUTED_STYLE_PROP(transition_delay,              TransitionDelay)
-COMPUTED_STYLE_PROP(transition_duration,           TransitionDuration)
-COMPUTED_STYLE_PROP(transition_property,           TransitionProperty)
-COMPUTED_STYLE_PROP(transition_timing_function,    TransitionTimingFunction)
-COMPUTED_STYLE_PROP(translate,                     Translate)
-COMPUTED_STYLE_PROP(unicode_bidi,                  UnicodeBidi)
-COMPUTED_STYLE_PROP(vertical_align,                VerticalAlign)
-COMPUTED_STYLE_PROP(visibility,                    Visibility)
-COMPUTED_STYLE_PROP(white_space,                   WhiteSpace)
-// COMPUTED_STYLE_PROP(widows,                     Widows)
-COMPUTED_STYLE_PROP(width,                         Width)
-COMPUTED_STYLE_PROP(will_change,                   WillChange)
-COMPUTED_STYLE_PROP(word_break,                    WordBreak)
-COMPUTED_STYLE_PROP(word_spacing,                  WordSpacing)
-COMPUTED_STYLE_PROP(writing_mode,                  WritingMode)
-COMPUTED_STYLE_PROP(z_index,                       ZIndex)
-
-/* ******************************* *\
- * Implementations of -moz- styles *
-\* ******************************* */
-
-COMPUTED_STYLE_PROP(_moz_appearance,               Appearance)
-COMPUTED_STYLE_PROP(_moz_binding,                  Binding)
-COMPUTED_STYLE_PROP(_moz_box_align,                BoxAlign)
-COMPUTED_STYLE_PROP(_moz_box_direction,            BoxDirection)
-COMPUTED_STYLE_PROP(_moz_box_flex,                 BoxFlex)
-COMPUTED_STYLE_PROP(_moz_box_ordinal_group,        BoxOrdinalGroup)
-COMPUTED_STYLE_PROP(_moz_box_orient,               BoxOrient)
-COMPUTED_STYLE_PROP(_moz_box_pack,                 BoxPack)
-COMPUTED_STYLE_PROP(_moz_context_properties,       ContextProperties)
-COMPUTED_STYLE_PROP(_moz_float_edge,               FloatEdge)
-COMPUTED_STYLE_PROP(_moz_font_smoothing_background_color, FontSmoothingBackgroundColor)
-COMPUTED_STYLE_PROP(_moz_force_broken_image_icon,  ForceBrokenImageIcon)
-COMPUTED_STYLE_PROP(_moz_image_region,             ImageRegion)
-COMPUTED_STYLE_PROP(_moz_orient,                   Orient)
-COMPUTED_STYLE_PROP(_moz_osx_font_smoothing,       OsxFontSmoothing)
-COMPUTED_STYLE_PROP(_moz_outline_radius_bottomleft, OutlineRadiusBottomLeft)
-COMPUTED_STYLE_PROP(_moz_outline_radius_bottomright,OutlineRadiusBottomRight)
-COMPUTED_STYLE_PROP(_moz_outline_radius_topleft,    OutlineRadiusTopLeft)
-COMPUTED_STYLE_PROP(_moz_outline_radius_topright,   OutlineRadiusTopRight)
-COMPUTED_STYLE_PROP(_moz_stack_sizing,             StackSizing)
-COMPUTED_STYLE_PROP(_moz_tab_size,                 TabSize)
-COMPUTED_STYLE_PROP(_moz_text_size_adjust,         TextSizeAdjust)
-COMPUTED_STYLE_PROP(_moz_user_focus,               UserFocus)
-COMPUTED_STYLE_PROP(_moz_user_input,               UserInput)
-COMPUTED_STYLE_PROP(_moz_user_modify,              UserModify)
-COMPUTED_STYLE_PROP(_moz_user_select,              UserSelect)
-COMPUTED_STYLE_PROP(_moz_window_dragging,          WindowDragging)
-COMPUTED_STYLE_PROP(_moz_window_shadow,            WindowShadow)
-COMPUTED_STYLE_PROP(_moz_window_opacity,           WindowOpacity)
-COMPUTED_STYLE_PROP(_moz_window_transform,         WindowTransform)
-COMPUTED_STYLE_PROP(_moz_window_transform_origin,  WindowTransformOrigin)
-
-/* ********************************** *\
- * Implementations of -webkit- styles *
-\* ********************************** */
-
-COMPUTED_STYLE_PROP(_webkit_text_fill_color,       WebkitTextFillColor)
-//// COMPUTED_STYLE_PROP(webkit-text-stroke,       WebkitTextStroke)
-COMPUTED_STYLE_PROP(_webkit_text_stroke_color,     WebkitTextStrokeColor)
-COMPUTED_STYLE_PROP(_webkit_text_stroke_width,     WebkitTextStrokeWidth)
-
-/* ***************************** *\
- * Implementations of SVG styles *
-\* ***************************** */
-
-COMPUTED_STYLE_PROP(clip_path,                     ClipPath)
-COMPUTED_STYLE_PROP(clip_rule,                     ClipRule)
-COMPUTED_STYLE_PROP(color_interpolation,           ColorInterpolation)
-COMPUTED_STYLE_PROP(color_interpolation_filters,   ColorInterpolationFilters)
-COMPUTED_STYLE_PROP(dominant_baseline,             DominantBaseline)
-COMPUTED_STYLE_PROP(fill,                          Fill)
-COMPUTED_STYLE_PROP(fill_opacity,                  FillOpacity)
-COMPUTED_STYLE_PROP(fill_rule,                     FillRule)
-COMPUTED_STYLE_PROP(filter,                        Filter)
-COMPUTED_STYLE_PROP(flood_color,                   FloodColor)
-COMPUTED_STYLE_PROP(flood_opacity,                 FloodOpacity)
-COMPUTED_STYLE_PROP(image_rendering,               ImageRendering)
-COMPUTED_STYLE_PROP(lighting_color,                LightingColor)
-COMPUTED_STYLE_PROP(marker_end,                    MarkerEnd)
-COMPUTED_STYLE_PROP(marker_mid,                    MarkerMid)
-COMPUTED_STYLE_PROP(marker_start,                  MarkerStart)
-COMPUTED_STYLE_PROP(mask,                          Mask)
-COMPUTED_STYLE_PROP(mask_clip,                     MaskClip)
-COMPUTED_STYLE_PROP(mask_composite,                MaskComposite)
-COMPUTED_STYLE_PROP(mask_image,                    MaskImage)
-COMPUTED_STYLE_PROP(mask_mode,                     MaskMode)
-COMPUTED_STYLE_PROP(mask_origin,                   MaskOrigin)
-COMPUTED_STYLE_PROP(mask_position,                 MaskPosition)
-COMPUTED_STYLE_PROP(mask_position_x,               MaskPositionX)
-COMPUTED_STYLE_PROP(mask_position_y,               MaskPositionY)
-COMPUTED_STYLE_PROP(mask_repeat,                   MaskRepeat)
-COMPUTED_STYLE_PROP(mask_size,                     MaskSize)
-COMPUTED_STYLE_PROP(mask_type,                     MaskType)
-COMPUTED_STYLE_PROP(paint_order,                   PaintOrder)
-COMPUTED_STYLE_PROP(shape_rendering,               ShapeRendering)
-COMPUTED_STYLE_PROP(stop_color,                    StopColor)
-COMPUTED_STYLE_PROP(stop_opacity,                  StopOpacity)
-COMPUTED_STYLE_PROP(stroke,                        Stroke)
-COMPUTED_STYLE_PROP(stroke_dasharray,              StrokeDasharray)
-COMPUTED_STYLE_PROP(stroke_dashoffset,             StrokeDashoffset)
-COMPUTED_STYLE_PROP(stroke_linecap,                StrokeLinecap)
-COMPUTED_STYLE_PROP(stroke_linejoin,               StrokeLinejoin)
-COMPUTED_STYLE_PROP(stroke_miterlimit,             StrokeMiterlimit)
-COMPUTED_STYLE_PROP(stroke_opacity,                StrokeOpacity)
-COMPUTED_STYLE_PROP(stroke_width,                  StrokeWidth)
-COMPUTED_STYLE_PROP(text_anchor,                   TextAnchor)
-COMPUTED_STYLE_PROP(text_rendering,                TextRendering)
-COMPUTED_STYLE_PROP(vector_effect,                 VectorEffect)
--- a/layout/style/test/test_bug657143.html
+++ b/layout/style/test/test_bug657143.html
@@ -49,23 +49,22 @@ function isCustom(aProp) {
   return aProp.startsWith("--");
 }
 
 function isNotCustom(aProp) {
   return !isCustom(aProp);
 }
 
 var styleList = window.getComputedStyle(document.documentElement);
-    cssA = [], mozA = [], webkitA = [], svgA = [], customA = [];
+    cssA = [], mozA = [], webkitA = [], customA = [];
 
 // Partition the list of property names into four lists:
 //
-//   cssA: regular, non-SVG properties
+//   cssA: regular properties
 //   mozA: '-moz-' prefixed properties
-//   svgA: SVG properties
 //   customA: '--' prefixed custom properties
 
 var list = cssA;
 for (var i = 0, j = styleList.length; i < j; i++) {
   var prop = styleList.item(i);
 
   switch (list) {
     case cssA:
@@ -74,40 +73,32 @@ for (var i = 0, j = styleList.length; i 
       }
       // fall through
     case mozA:
       if (isWebkitPrefixed(prop)) {
         list = webkitA;
       }
       // fall through
     case webkitA:
-      // Assume that the first SVG property is 'clip-path'.
-      if (prop == "clip-path") {
-        list = svgA;
-      }
-      // fall through
-    case svgA:
       if (isCustom(prop)) {
         list = customA;
       }
       // fall through
   }
 
   list.push(prop);
 }
 
 var cssB = cssA.slice(0).sort(),
     mozB = mozA.slice(0).sort(),
-    webkitB = webkitA.slice(0).sort(),
-    svgB = svgA.slice(0).sort();
+    webkitB = webkitA.slice(0).sort();
 
 is(cssA.toString(), cssB.toString(), 'CSS property list should be alphabetical');
 is(mozA.toString(), mozB.toString(), 'Experimental -moz- CSS property list should be alphabetical');
 is(webkitA.toString(), webkitB.toString(), 'Compatible -webkit- CSS property list should be alphabetical');
-is(svgA.toString(), svgB.toString(), 'SVG property list should be alphabetical');
 
 // We don't test that the custom property list is sorted, as the CSSOM
 // specification does not yet require it, and we don't return them
 // in sorted order.
 
 ok(!cssA.find(isWebkitPrefixed), 'Compatible -webkit- CSS properties should not be in the mature CSS property list');
 ok(!cssA.find(isMozPrefixed), 'Experimental -moz- CSS properties should not be in the mature CSS property list');
 ok(!cssA.find(isCustom), 'Custom CSS properties should not be in the mature CSS property list');
@@ -116,17 +107,14 @@ ok(!mozA.find(isWebkitPrefixed), 'Compat
 ok(!mozA.find(isNotMozPrefixed), 'Experimental -moz- CSS property list should not contain non -moz- prefixed '
                                   + 'CSS properties');
 ok(!mozA.find(isCustom), 'Custom CSS properties should not be in the experimental -moz- CSS property list');
 ok(!webkitA.find(isNotWebkitPrefixed), 'Compatible -webkit- CSS properties should not contain non -webkit- prefixed '
                                         + 'CSS properties');
 ok(!webkitA.find(isMozPrefixed), 'Experimental -moz- CSS properties should not be in the compatible -webkit- CSS '
                                   + 'property list');
 ok(!webkitA.find(isCustom), 'Custom CSS properties should not be in the compatible -webkit- CSS property list');
-ok(!svgA.find(isWebkitPrefixed), 'Compatible -webkit- CSS properties should not be in the SVG property list'); 
-ok(!svgA.find(isMozPrefixed), 'Experimental -moz- CSS properties should not be in the SVG property list');
-ok(!svgA.find(isCustom), 'Custom CSS properties should not be in the SVG property list');
 ok(!customA.find(isNotCustom), 'Non-custom CSS properties should not be in the custom property list');
 
 </script>
 </pre>
 </body>
 </html>
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -830,16 +830,18 @@ bitflags! {
         /// to be flushed.
         const GETCS_NEEDS_LAYOUT_FLUSH = 1 << 6;
 
         /* The following flags are currently not used in Rust code, they
          * only need to be listed in corresponding properties so that
          * they can be checked in the C++ side via ServoCSSPropList.h. */
         /// This property can be animated on the compositor.
         const CAN_ANIMATE_ON_COMPOSITOR = 0;
+        /// This shorthand property is accessible from getComputedStyle.
+        const SHORTHAND_IN_GETCS = 0;
     }
 }
 
 /// An identifier for a given longhand property.
 #[derive(Clone, Copy, Eq, Hash, MallocSizeOf, PartialEq)]
 #[repr(u16)]
 pub enum LonghandId {
     % for i, property in enumerate(data.longhands):
--- a/servo/components/style/properties/shorthands/background.mako.rs
+++ b/servo/components/style/properties/shorthands/background.mako.rs
@@ -191,16 +191,17 @@
             }
 
             Ok(())
         }
     }
 </%helpers:shorthand>
 
 <%helpers:shorthand name="background-position"
+                    flags="SHORTHAND_IN_GETCS"
                     sub_properties="background-position-x background-position-y"
                     spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position">
     use properties::longhands::{background_position_x, background_position_y};
     use values::specified::AllowQuirks;
     use values::specified::position::Position;
 
     pub fn parse_value<'i, 't>(
         context: &ParserContext,
--- a/servo/components/style/properties/shorthands/box.mako.rs
+++ b/servo/components/style/properties/shorthands/box.mako.rs
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 <%namespace name="helpers" file="/helpers.mako.rs" />
 
 <%helpers:shorthand
     name="overflow"
+    flags="SHORTHAND_IN_GETCS"
     sub_properties="overflow-x overflow-y"
     spec="https://drafts.csswg.org/css-overflow/#propdef-overflow"
 >
     use properties::longhands::overflow_x::parse as parse_overflow;
     % if product == "gecko":
         use properties::longhands::overflow_x::SpecifiedValue;
     % endif
 
--- a/servo/components/style/properties/shorthands/font.mako.rs
+++ b/servo/components/style/properties/shorthands/font.mako.rs
@@ -280,16 +280,17 @@
             ${p}::collect_completion_keywords(f);
             % endfor
             <longhands::system_font::SystemFont as SpecifiedValueInfo>::collect_completion_keywords(f);
         }
     }
 </%helpers:shorthand>
 
 <%helpers:shorthand name="font-variant"
+                    flags="SHORTHAND_IN_GETCS"
                     sub_properties="font-variant-caps
                                     ${'font-variant-alternates' if product == 'gecko' else ''}
                                     ${'font-variant-east-asian' if product == 'gecko' else ''}
                                     ${'font-variant-ligatures' if product == 'gecko' else ''}
                                     ${'font-variant-numeric' if product == 'gecko' else ''}
                                     ${'font-variant-position' if product == 'gecko' else ''}"
                     spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-variant">
     <% gecko_sub_properties = "alternates east_asian ligatures numeric position".split() %>
--- a/servo/components/style/properties/shorthands/svg.mako.rs
+++ b/servo/components/style/properties/shorthands/svg.mako.rs
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 <%namespace name="helpers" file="/helpers.mako.rs" />
 
 <%helpers:shorthand name="mask" products="gecko" extra_prefixes="webkit"
+                    flags="SHORTHAND_IN_GETCS"
                     sub_properties="mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x
                                     mask-position-y mask-size mask-image"
                     spec="https://drafts.fxtf.org/css-masking/#propdef-mask">
     use properties::longhands::{mask_mode, mask_repeat, mask_clip, mask_origin, mask_composite, mask_position_x,
                                 mask_position_y};
     use properties::longhands::{mask_size, mask_image};
     use values::specified::{Position, PositionComponent};
     use parser::Parse;
@@ -177,16 +178,17 @@
             }
 
             Ok(())
         }
     }
 </%helpers:shorthand>
 
 <%helpers:shorthand name="mask-position" products="gecko" extra_prefixes="webkit"
+                    flags="SHORTHAND_IN_GETCS"
                     sub_properties="mask-position-x mask-position-y"
                     spec="https://drafts.csswg.org/css-masks-4/#the-mask-position">
     use properties::longhands::{mask_position_x,mask_position_y};
     use values::specified::position::Position;
     use parser::Parse;
 
     pub fn parse_value<'i, 't>(
         context: &ParserContext,
--- a/servo/components/style/properties/shorthands/text.mako.rs
+++ b/servo/components/style/properties/shorthands/text.mako.rs
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 <%namespace name="helpers" file="/helpers.mako.rs" />
 
 <%helpers:shorthand name="text-decoration"
+                    flags="SHORTHAND_IN_GETCS"
                     sub_properties="text-decoration-line
                     ${' text-decoration-style text-decoration-color' if product == 'gecko' else ''}"
                     spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration">
 
     % if product == "gecko":
         use values::specified;
         use properties::longhands::{text_decoration_line, text_decoration_style, text_decoration_color};
     % else: