mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
style: Move represents_keyword to the css attributes.
Bug: 1457635 Reviewed-by: xidorn MozReview-Commit-ID: 21yuU4h34AQ
This commit is contained in:
parent
a375baf84b
commit
c508d8576d
8 changed files with 24 additions and 69 deletions
|
@ -189,6 +189,15 @@ fn derive_single_field_expr(
|
|||
writer.item(&item)?;
|
||||
}
|
||||
}
|
||||
} else if attrs.represents_keyword {
|
||||
let ident =
|
||||
field.ast().ident.as_ref().expect("Unnamed field with represents_keyword?");
|
||||
let ident = cg::to_css_identifier(ident.as_ref());
|
||||
quote! {
|
||||
if *#field {
|
||||
writer.raw_item(#ident)?;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if attrs.field_bound {
|
||||
let ty = &field.ast().ty;
|
||||
|
@ -236,5 +245,6 @@ pub struct CssFieldAttrs {
|
|||
pub field_bound: bool,
|
||||
pub iterable: bool,
|
||||
pub skip: bool,
|
||||
pub represents_keyword: bool,
|
||||
pub skip_if: Option<Path>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue