style: Skip system font variant for ToCss in font subproperties.

System font keywords are not a valid value for those properties.

The newly-added #[css(skip)] would be reused by deriving algorithm of
SpecifiedValueInfo to skip them as well.

Bug: 1434130
Reviewed-by: emilio
MozReview-Commit-ID: EmnhkaA9RR5
This commit is contained in:
Xidorn Quan 2018-04-29 09:03:31 +10:00 committed by Emilio Cobos Álvarez
parent 6e3fa68f46
commit 3b9c40dd14
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 23 additions and 0 deletions

View file

@ -78,6 +78,9 @@ fn derive_variant_arm(
let variant_attrs = cg::parse_variant_attrs_from_ast::<CssVariantAttrs>(&ast);
let separator = if variant_attrs.comma { ", " } else { " " };
if variant_attrs.skip {
return quote!(Ok(()));
}
if variant_attrs.dimension {
assert_eq!(bindings.len(), 1);
assert!(
@ -223,6 +226,7 @@ pub struct CssVariantAttrs {
pub dimension: bool,
pub keyword: Option<String>,
pub aliases: Option<String>,
pub skip: bool,
}
#[darling(attributes(css), default)]