mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
8821ad72f4
commit
2c0a19e517
8 changed files with 39 additions and 29 deletions
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -594,7 +594,7 @@
|
|||
aliases.append(alias)
|
||||
%>
|
||||
% if aliases:
|
||||
#[css(aliases = "${','.join(aliases)}")]
|
||||
#[parse(aliases = "${','.join(aliases)}")]
|
||||
% endif
|
||||
% endif
|
||||
${to_camel_case(variant)},
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue