3 # User Simon Sapin <simon.sapin@exyr.org>
4 # Date 1547211748 -3600
5 # Node ID 4f2e84dc490dbbac2a35799b6b9230c105f2cd35
6 # Parent 07acdca43a9b5e69f0f01d74dab7f6d2e6ef30f2
7 Bug 1519729 - Remove unused macro. r=emilio
9 Cherry-picks a commit from https://github.com/servo/servo/pull/22674
12 diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
13 --- a/servo/components/style_traits/values.rs
14 +++ b/servo/components/style_traits/values.rs
15 @@ -153,34 +153,16 @@ where
16 if !prefix.is_empty() {
17 self.inner.write_str(prefix)?;
20 self.inner.write_char(c)
25 -macro_rules! serialize_function {
26 - ($dest: expr, $name: ident($( $arg: expr, )+)) => {
27 - serialize_function!($dest, $name($($arg),+))
29 - ($dest: expr, $name: ident($first_arg: expr $( , $arg: expr )*)) => {
31 - $dest.write_str(concat!(stringify!($name), "("))?;
32 - $first_arg.to_css($dest)?;
34 - $dest.write_str(", ")?;
35 - $arg.to_css($dest)?;
37 - $dest.write_char(')')
42 /// Convenience wrapper to serialise CSS values separated by a given string.
43 pub struct SequenceWriter<'a, 'b: 'a, W: 'b> {
44 inner: &'a mut CssWriter<'b, W>,
45 separator: &'static str,
48 impl<'a, 'b, W> SequenceWriter<'a, 'b, W>
53 # User Simon Sapin <simon.sapin@exyr.org>
54 # Date 1547211824 -3600
55 # Node ID f63ebd7e9e281f22e71c268151337178de2c246a
56 # Parent 4f2e84dc490dbbac2a35799b6b9230c105f2cd35
57 Bug 1519729 - Document public macros. r=emilio
59 Undocumented public macros emit warnings in nightly-2019-01-11,
60 and we #![deny] that warning.
62 Cherry-picks a commit from https://github.com/servo/servo/pull/22674
65 diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs
66 --- a/servo/components/style/properties/properties.mako.rs
67 +++ b/servo/components/style/properties/properties.mako.rs
68 @@ -3816,17 +3816,24 @@ impl AliasId {
69 % for property in data.all_aliases():
70 AliasId::${property.camel_case} => "${property.camel_case}",
73 formatter.write_str(name)
77 -// NOTE(emilio): Callers are responsible to deal with prefs.
78 +/// Call the given macro with tokens like this for each longhand and shorthand properties
79 +/// that is enabled in content:
82 +/// [CamelCaseName, SetCamelCaseName, PropertyId::Longhand(LonghandId::CamelCaseName)],
85 +/// NOTE(emilio): Callers are responsible to deal with prefs.
87 macro_rules! css_properties_accessors {
88 ($macro_name: ident) => {
90 % for kind, props in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
91 % for property in props:
92 % if property.enabled_in_content():
93 % for name in [property.name] + property.alias:
94 @@ -3839,16 +3846,24 @@ macro_rules! css_properties_accessors {
103 +/// Call the given macro with tokens like this for each longhand properties:
106 +/// { snake_case_ident, true }
109 +/// … where the boolean indicates whether the property value type
110 +/// is wrapped in a `Box<_>` in the corresponding `PropertyDeclaration` variant.
112 macro_rules! longhand_properties_idents {
113 ($macro_name: ident) => {
115 % for property in data.longhands:
116 { ${property.ident}, ${"true" if property.boxed else "false"} }
119 diff --git a/servo/components/style_traits/values.rs b/servo/components/style_traits/values.rs
120 --- a/servo/components/style_traits/values.rs
121 +++ b/servo/components/style_traits/values.rs
122 @@ -427,17 +427,17 @@ impl_to_css_for_predefined_type!(i8);
123 impl_to_css_for_predefined_type!(i32);
124 impl_to_css_for_predefined_type!(u16);
125 impl_to_css_for_predefined_type!(u32);
126 impl_to_css_for_predefined_type!(::cssparser::Token<'a>);
127 impl_to_css_for_predefined_type!(::cssparser::RGBA);
128 impl_to_css_for_predefined_type!(::cssparser::Color);
129 impl_to_css_for_predefined_type!(::cssparser::UnicodeRange);
132 +/// Define an enum type with unit variants that each corrsepond to a CSS keyword.
133 macro_rules! define_css_keyword_enum {
134 (pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {
135 #[allow(missing_docs)]
136 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
137 #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq)]
144 # User Emilio Cobos Álvarez <emilio@crisal.io>
145 # Date 1547412158 -3600
146 # Node ID 1a1d8b9f1a3ab704ab277407823f6f42dd63a3d4
147 # Parent a2f691714d70fa6a9119503270809fa0eb8df6c6
148 Bug 1519629 - Document a few more macros.
151 diff --git a/servo/components/style/gecko/regen_atoms.py b/servo/components/style/gecko/regen_atoms.py
152 --- a/servo/components/style/gecko/regen_atoms.py
153 +++ b/servo/components/style/gecko/regen_atoms.py
154 @@ -125,16 +125,17 @@ PRELUDE = '''
155 RULE_TEMPLATE = ('("{atom}") =>\n '
157 '#[allow(unsafe_code)] #[allow(unused_unsafe)]'
158 'unsafe {{ $crate::string_cache::atom_macro::atom_from_static'
159 '($crate::string_cache::atom_macro::{name} as *mut _) }}'
163 +/// Returns a static atom by passing the literal string it represents.
171 def write_atom_macro(atoms, file_name):
172 diff --git a/servo/components/style/gecko_string_cache/namespace.rs b/servo/components/style/gecko_string_cache/namespace.rs
173 --- a/servo/components/style/gecko_string_cache/namespace.rs
174 +++ b/servo/components/style/gecko_string_cache/namespace.rs
177 use gecko_bindings::structs::nsAtom;
178 use precomputed_hash::PrecomputedHash;
179 use std::borrow::Borrow;
182 use string_cache::{Atom, WeakAtom};
184 +/// In Gecko namespaces are just regular atoms, so this is a simple macro to
185 +/// forward one macro to the other.
188 () => { $crate::string_cache::Namespace(atom!("")) };
189 ($s: tt) => { $crate::string_cache::Namespace(atom!($s)) };
192 /// A Gecko namespace is just a wrapped atom.
193 #[derive(Clone, Debug, Default, Eq, Hash, MallocSizeOf, PartialEq)]
194 --- firefox-60.6.1/servo/components/style/properties/properties.mako.rs.orig 2019-03-22 06:01:07.000000000 +0100
195 +++ firefox-60.6.1/servo/components/style/properties/properties.mako.rs 2019-04-14 12:19:55.687706977 +0200
198 pub use self::declaration_block::*;
201 #[cfg(feature = "gecko")]
203 macro_rules! property_name {