Skip to content

Commit

Permalink
Document public macros.
Browse files Browse the repository at this point in the history
Undocumented public macros emit warnings in nightly-2019-01-11,
and we #![deny] that warning.
  • Loading branch information
SimonSapin committed Jan 11, 2019
1 parent 9b98beb commit 3a710f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion components/style/properties/properties.mako.rs
Expand Up @@ -3821,7 +3821,14 @@ impl AliasId {
}
}

// NOTE(emilio): Callers are responsible to deal with prefs.
/// Call the given macro with tokens like this for each longhand and shorthand properties
/// that is enabled in content:
///
/// ```
/// [CamelCaseName, SetCamelCaseName, PropertyId::Longhand(LonghandId::CamelCaseName)],
/// ```
///
/// NOTE(emilio): Callers are responsible to deal with prefs.
#[macro_export]
macro_rules! css_properties_accessors {
($macro_name: ident) => {
Expand All @@ -3844,6 +3851,14 @@ macro_rules! css_properties_accessors {
}
}

/// Call the given macro with tokens like this for each longhand properties:
///
/// ```
/// { snake_case_ident, true }
/// ```
///
/// … where the boolean indicates whether the property value type
/// is wrapped in a `Box<_>` in the corresponding `PropertyDeclaration` variant.
#[macro_export]
macro_rules! longhand_properties_idents {
($macro_name: ident) => {
Expand Down
2 changes: 1 addition & 1 deletion components/style_traits/values.rs
Expand Up @@ -432,7 +432,7 @@ impl_to_css_for_predefined_type!(::cssparser::RGBA);
impl_to_css_for_predefined_type!(::cssparser::Color);
impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);

#[macro_export]
/// Define an enum type with unit variants that each corrsepond to a CSS keyword.
macro_rules! define_css_keyword_enum {
(pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
#[allow(missing_docs)]
Expand Down

0 comments on commit 3a710f2

Please sign in to comment.