style: Move some parsing-only attributes to use #[parse(..)] instead of #[css(..)].

I need to admit I'm ambivalent about this one :).

Bug: 1466609
Reviewed-by: xidorn
MozReview-Commit-ID: F1jlfnQKXwo
This commit is contained in:
Emilio Cobos Álvarez 2018-06-04 19:24:43 +02:00
parent 8821ad72f4
commit 2c0a19e517
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 39 additions and 29 deletions

View file

@ -157,12 +157,12 @@ impl<'a> ParserContext<'a> {
///
/// The derive code understands the following attributes on each of the variants:
///
/// * `#[css(aliases = "foo,bar")]` can be used to alias a value with another
/// * `#[parse(aliases = "foo,bar")]` can be used to alias a value with another
/// at parse-time.
///
/// * `#[css(parse_condition = "function")]` can be used to make the parsing of
/// the value conditional on `function`, which will be invoked with a
/// `&ParserContext` reference.
/// * `#[parse(condition = "function")]` can be used to make the parsing of the
/// value conditional on `function`, which needs to fulfill
/// `fn(&ParserContext) -> bool`.
pub trait Parse: Sized {
/// Parse a value of this type.
///

View file

@ -594,7 +594,7 @@
aliases.append(alias)
%>
% if aliases:
#[css(aliases = "${','.join(aliases)}")]
#[parse(aliases = "${','.join(aliases)}")]
% endif
% endif
${to_camel_case(variant)},

View file

@ -53,9 +53,9 @@ pub enum Display {
TableCaption,
ListItem,
None,
#[css(aliases = "-webkit-flex")]
#[parse(aliases = "-webkit-flex")]
Flex,
#[css(aliases = "-webkit-inline-flex")]
#[parse(aliases = "-webkit-inline-flex")]
InlineFlex,
#[cfg(feature = "gecko")]
Grid,
@ -84,31 +84,31 @@ pub enum Display {
#[cfg(feature = "gecko")]
MozInlineBox,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozGrid,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozInlineGrid,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozGridGroup,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozGridLine,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozStack,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozInlineStack,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozDeck,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozPopup,
#[cfg(feature = "gecko")]
#[css(parse_condition = "moz_display_values_enabled")]
#[parse(condition = "moz_display_values_enabled")]
MozGroupbox,
}