diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 2b16f527e91..9db3d076fae 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -37,12 +37,17 @@ // and handle the empty case correctly <%doc> To be used in cases where we have a grammar like - " [ , ]*", but only support a single value - in servo + " [ , ]*". `gecko_only` should be set + to True for cases where Servo takes a single value + and Stylo supports vector values. + + If the computed value is the same as the specified value, + setting computed_is_specified to True will introduce additional + optimizations -<%def name="gecko_autoarray_longhand(name, **kwargs)"> +<%def name="vector_longhand(name, gecko_only=False, **kwargs)"> <%call expr="longhand(name, **kwargs)"> - % if product == "gecko": + % if product == "gecko" or not gecko_only: use cssparser::ToCss; use std::fmt; diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index f66e8d85af1..26dbf123df8 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -10,7 +10,7 @@ ${helpers.predefined_type("background-color", "CSSColor", "::cssparser::Color::RGBA(::cssparser::RGBA { red: 0., green: 0., blue: 0., alpha: 0. }) /* transparent */", animatable=True)} -<%helpers:gecko_autoarray_longhand name="background-image" animatable="False"> +<%helpers:vector_longhand gecko_only="True" name="background-image" animatable="False"> use cssparser::ToCss; use std::fmt; use values::specified::Image; @@ -70,7 +70,7 @@ ${helpers.predefined_type("background-color", "CSSColor", } } } - + <%helpers:longhand name="background-position" animatable="True"> use cssparser::ToCss;