From 9b98beb7693a9fc9e70bbf3f1ea6d6cafbfa7857 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 11 Jan 2019 14:02:28 +0100 Subject: [PATCH 1/3] Remove unused macro --- components/style_traits/values.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 6da235c07b6..2851082c22e 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -158,24 +158,6 @@ where } } -#[macro_export] -macro_rules! serialize_function { - ($dest: expr, $name: ident($( $arg: expr, )+)) => { - serialize_function!($dest, $name($($arg),+)) - }; - ($dest: expr, $name: ident($first_arg: expr $( , $arg: expr )*)) => { - { - $dest.write_str(concat!(stringify!($name), "("))?; - $first_arg.to_css($dest)?; - $( - $dest.write_str(", ")?; - $arg.to_css($dest)?; - )* - $dest.write_char(')') - } - } -} - /// Convenience wrapper to serialise CSS values separated by a given string. pub struct SequenceWriter<'a, 'b: 'a, W: 'b> { inner: &'a mut CssWriter<'b, W>, From 3a710f22eddade12bb61689869515ec6a8c4cc26 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 11 Jan 2019 14:03:44 +0100 Subject: [PATCH 2/3] Document public macros. Undocumented public macros emit warnings in nightly-2019-01-11, and we #![deny] that warning. --- components/style/properties/properties.mako.rs | 17 ++++++++++++++++- components/style_traits/values.rs | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 2d91273be15..9220c3b1a66 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -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) => { @@ -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) => { diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 2851082c22e..0d7ee3f506c 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -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)] From 87e6ef3ddea84c1afddd5a7a28025fa1baf16c80 Mon Sep 17 00:00:00 2001 From: lqd Date: Fri, 11 Jan 2019 16:35:26 +0100 Subject: [PATCH 3/3] Typo fix in new doc-comment Co-Authored-By: SimonSapin --- components/style_traits/values.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 0d7ee3f506c..582e34eb3db 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -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); -/// Define an enum type with unit variants that each corrsepond to a CSS keyword. +/// Define an enum type with unit variants that each correspond to a CSS keyword. macro_rules! define_css_keyword_enum { (pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => { #[allow(missing_docs)]