mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Move represents_keyword to the css attributes.
Bug: 1457635 Reviewed-by: xidorn MozReview-Commit-ID: 21yuU4h34AQ
This commit is contained in:
parent
a375baf84b
commit
c508d8576d
8 changed files with 24 additions and 69 deletions
|
@ -56,8 +56,6 @@ pub type KeywordsCollectFn<'a> = &'a mut FnMut(&[&'static str]);
|
|||
/// * `#[value_info(starts_with_keyword)]` can be used on variants to
|
||||
/// add the name of a non-unit variant (serialized like `ToCss`) into
|
||||
/// `collect_completion_keywords`.
|
||||
/// * `#[value_info(represents_keyword)]` can be used on fields into
|
||||
/// `collect_completion_keywords`.
|
||||
pub trait SpecifiedValueInfo {
|
||||
/// Supported CssTypes by the given value type.
|
||||
///
|
||||
|
|
|
@ -37,6 +37,9 @@ use std::fmt::{self, Write};
|
|||
/// * if `#[css(skip_if = "function")]` is found on a field, the `ToCss` call
|
||||
/// for that field is skipped if `function` returns true. This function is
|
||||
/// provided the field as an argument;
|
||||
/// * `#[css(represents_keyword)]` can be used on bool fields in order to
|
||||
/// serialize the field name if the field is true, or nothing otherwise. It
|
||||
/// also collects those keywords for `SpecifiedValueInfo`.
|
||||
/// * finally, one can put `#[css(derive_debug)]` on the whole type, to
|
||||
/// implement `Debug` by a single call to `ToCss::to_css`.
|
||||
pub trait ToCss {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue