Bug 1468651: remove shorthand/serialize.mako.rs. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 13 Jun 2018 15:31:05 -0700
changeset 808373 13b207c7107e2f5aeafb373298702b70261ea187
parent 808372 ecf1b1e3f67ebda0d901eb5fef07a45c41ed5143
child 808374 a439081cd95df071d110ac912bd2b211f21b7ba0
push id113370
push userbmo:emilio@crisal.io
push dateTue, 19 Jun 2018 11:33:09 +0000
reviewersheycam
bugs1468651
milestone62.0a1
Bug 1468651: remove shorthand/serialize.mako.rs. r?heycam MozReview-Commit-ID: 8Xyep2Q7trR
servo/components/style/properties/properties.mako.rs
servo/components/style/properties/shorthand/serialize.mako.rs
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -132,17 +132,42 @@ macro_rules! unwrap_or_initial {
 /// serialization helpers.
 #[allow(missing_docs)]
 pub mod shorthands {
     use cssparser::Parser;
     use parser::{Parse, ParserContext};
     use style_traits::{ParseError, StyleParseErrorKind};
     use values::specified;
 
-    <%include file="/shorthand/serialize.mako.rs" />
+    use style_traits::{CssWriter, ToCss};
+    use values::specified::{BorderStyle, Color};
+    use std::fmt::{self, Write};
+
+    fn serialize_directional_border<W, I,>(
+        dest: &mut CssWriter<W>,
+        width: &I,
+        style: &BorderStyle,
+        color: &Color,
+    ) -> fmt::Result
+    where
+        W: Write,
+        I: ToCss,
+    {
+        width.to_css(dest)?;
+        // FIXME(emilio): Should we really serialize the border style if it's
+        // `solid`?
+        dest.write_str(" ")?;
+        style.to_css(dest)?;
+        if *color != Color::CurrentColor {
+            dest.write_str(" ")?;
+            color.to_css(dest)?;
+        }
+        Ok(())
+    }
+
     <%include file="/shorthand/background.mako.rs" />
     <%include file="/shorthand/border.mako.rs" />
     <%include file="/shorthand/box.mako.rs" />
     <%include file="/shorthand/column.mako.rs" />
     <%include file="/shorthand/font.mako.rs" />
     <%include file="/shorthand/inherited_text.mako.rs" />
     <%include file="/shorthand/list.mako.rs" />
     <%include file="/shorthand/margin.mako.rs" />
deleted file mode 100644
--- a/servo/components/style/properties/shorthand/serialize.mako.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-use style_traits::{CssWriter, ToCss};
-use values::specified::{BorderStyle, Color};
-use std::fmt::{self, Write};
-
-fn serialize_directional_border<W, I,>(
-    dest: &mut CssWriter<W>,
-    width: &I,
-    style: &BorderStyle,
-    color: &Color,
-) -> fmt::Result
-where
-    W: Write,
-    I: ToCss,
-{
-    width.to_css(dest)?;
-    dest.write_str(" ")?;
-    style.to_css(dest)?;
-    if *color != Color::CurrentColor {
-        dest.write_str(" ")?;
-        color.to_css(dest)?;
-    }
-    Ok(())
-}