diff options
Diffstat (limited to 'components/style/parser.rs')
-rw-r--r-- | components/style/parser.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/components/style/parser.rs b/components/style/parser.rs index 26f4aeea071..1b7c65e2559 100644 --- a/components/style/parser.rs +++ b/components/style/parser.rs @@ -150,10 +150,19 @@ impl<'a> ParserContext<'a> { } } -// XXXManishearth Replace all specified value parse impls with impls of this -// trait. This will make it easy to write more generic values in the future. /// A trait to abstract parsing of a specified value given a `ParserContext` and /// CSS input. +/// +/// This can be derived on keywords with `#[derive(Parse)]`. +/// +/// 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 +/// 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. pub trait Parse: Sized { /// Parse a value of this type. /// |