Bug 1468651: remove shorthand/serialize.mako.rs. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 13 Jun 2018 15:31:05 -0700
changeset 423140 e3b98fb8b7131f4c77073f2d3c4a5cafe93be00b
parent 423139 86ef0de352d228ef19cf5e69043d2433725e3501
child 423141 6b23758e71d03125e235132b2f25750f9a577800
push id34164
push usercsabou@mozilla.com
push dateThu, 21 Jun 2018 01:17:13 +0000
treeherdermozilla-central@d231a3231680 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1468651
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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(())
-}