mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Introduce css(parse_condition).
This will allow us to add a pref for this, and to parse it only on chrome easily. Bug: 1288572 Reviewed-by: xidorn MozReview-Commit-ID: L1rsyc2A2hu
This commit is contained in:
parent
ce5a85d6a1
commit
1da798e65b
3 changed files with 50 additions and 8 deletions
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue