diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 483ac9907e0..65d714971ed 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -28,9 +28,9 @@ pub enum Display { Table, InlineTable, TableRowGroup, TableHeaderGroup, TableFooterGroup, TableRow, TableColumnGroup, TableColumn, TableCell, TableCaption, ListItem, None, - #[parse(aliases = "-webkit-flex")] + #[css(aliases = "-webkit-flex")] Flex, - #[parse(aliases = "-webkit-inline-flex")] + #[css(aliases = "-webkit-inline-flex")] InlineFlex, #[cfg(feature = "gecko")] Grid, diff --git a/components/style_derive/lib.rs b/components/style_derive/lib.rs index a9a8a32dbf7..7778b7ea39c 100644 --- a/components/style_derive/lib.rs +++ b/components/style_derive/lib.rs @@ -39,7 +39,7 @@ pub fn derive_to_animated_value(stream: TokenStream) -> TokenStream { to_animated_value::derive(input).to_string().parse().unwrap() } -#[proc_macro_derive(Parse, attributes(parse))] +#[proc_macro_derive(Parse, attributes(css))] pub fn derive_parse(stream: TokenStream) -> TokenStream { let input = syn::parse_derive_input(&stream.to_string()).unwrap(); parse::derive(input).to_string().parse().unwrap() diff --git a/components/style_derive/parse.rs b/components/style_derive/parse.rs index cac626749bd..48533e45f2f 100644 --- a/components/style_derive/parse.rs +++ b/components/style_derive/parse.rs @@ -6,6 +6,7 @@ use cg; use quote::Tokens; use syn::DeriveInput; use synstructure; +use to_css::CssVariantAttrs; pub fn derive(input: DeriveInput) -> Tokens { let name = &input.ident; @@ -19,7 +20,7 @@ pub fn derive(input: DeriveInput) -> Tokens { "Parse is only supported for single-variant enums for now" ); - let variant_attrs = cg::parse_variant_attrs::(variant); + let variant_attrs = cg::parse_variant_attrs::(variant); let identifier = cg::to_css_identifier(variant.ident.as_ref()); let ident = &variant.ident; @@ -87,11 +88,3 @@ pub fn derive(input: DeriveInput) -> Tokens { #methods_impl } } - -#[darling(attributes(parse), default)] -#[derive(Default, FromVariant)] -struct ParseVariantAttrs { - /// The comma-separated list of aliases this variant should be aliased to at - /// parse time. - aliases: Option, -} diff --git a/components/style_derive/to_css.rs b/components/style_derive/to_css.rs index de48f4612e4..57d04f00547 100644 --- a/components/style_derive/to_css.rs +++ b/components/style_derive/to_css.rs @@ -123,11 +123,12 @@ struct CssInputAttrs { #[darling(attributes(css), default)] #[derive(Default, FromVariant)] -struct CssVariantAttrs { - function: Option, - iterable: bool, - comma: bool, - dimension: bool, +pub struct CssVariantAttrs { + pub function: Option, + pub iterable: bool, + pub comma: bool, + pub dimension: bool, + pub aliases: Option, } #[darling(attributes(css), default)] @@ -136,7 +137,7 @@ struct CssFieldAttrs { ignore_bound: bool, } -struct Function { +pub struct Function { name: Option, }