mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
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:
parent
ce62cb1ba7
commit
a6328ba3ce
4 changed files with 64 additions and 22 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue