diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 6be3ec6e8b4..0ac35003ff9 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -145,7 +145,11 @@ class PropertiesData(object): return longand - def declare_shorthand(self, name, sub_properties, *args, **kwargs): + def declare_shorthand(self, name, sub_properties, products="gecko servo", *args, **kwargs): + products = products.split() + if self.product not in products: + return + sub_properties = [self.longhands_by_name[s] for s in sub_properties] shorthand = Shorthand(name, sub_properties, *args, **kwargs) self.shorthands.append(shorthand) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index eed9a686549..af052179d2c 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -191,10 +191,12 @@ -<%def name="shorthand(name, sub_properties, experimental=False)"> +<%def name="shorthand(name, sub_properties, experimental=False, **kwargs)"> <% - shorthand = data.declare_shorthand(name, sub_properties.split(), experimental=experimental) + shorthand = data.declare_shorthand(name, sub_properties.split(), experimental=experimental, + **kwargs) %> + % if shorthand: pub mod ${shorthand.ident} { use cssparser::Parser; use parser::ParserContext; @@ -252,6 +254,7 @@ ${caller.body()} } } + % endif <%def name="four_sides_shorthand(name, sub_property_pattern, parser_function)">