style: Ensure all lonhands have a working clone(), and to_css.

This removes some dubious font-family code too.

It ensures that vector longhands have a proper clone implementation
auto-generating it using `collect()`.

Bug: 1461296
Reviewed-by: xidorn
MozReview-Commit-ID: FkdnbTkeF6E
This commit is contained in:
Emilio Cobos Álvarez 2018-05-14 12:40:31 +02:00
parent ce62cb1ba7
commit a6328ba3ce
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 64 additions and 22 deletions

View file

@ -2399,6 +2399,18 @@ pub mod style_structs {
-> longhands::${longhand.ident}::computed_value::SingleComputedValue {
self.${longhand.ident}_at(index % self.${longhand.ident}_count())
}
/// Clone the computed value for the property.
#[allow(non_snake_case)]
#[inline]
#[cfg(feature = "gecko")]
pub fn clone_${longhand.ident}(
&self,
) -> longhands::${longhand.ident}::computed_value::T {
longhands::${longhand.ident}::computed_value::T(
self.${longhand.ident}_iter().collect()
)
}
% endif
% endfor