From 5c15c59f56934b1ce6b0038976cccbbd21aafdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 13 Jun 2018 15:31:05 -0700 Subject: [PATCH] style: remove shorthand/serialize.mako.rs. Bug: 1468651 Reviewed-by: heycam MozReview-Commit-ID: 8Xyep2Q7trR --- .../style/properties/properties.mako.rs | 27 ++++++++++++++++++- .../properties/shorthand/serialize.mako.rs | 27 ------------------- 2 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 components/style/properties/shorthand/serialize.mako.rs diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 4d18e0ca634..e74fc888e4e 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -137,7 +137,32 @@ pub mod shorthands { 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( + dest: &mut CssWriter, + 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" /> diff --git a/components/style/properties/shorthand/serialize.mako.rs b/components/style/properties/shorthand/serialize.mako.rs deleted file mode 100644 index afcbe3c488b..00000000000 --- a/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( - dest: &mut CssWriter, - 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(()) -}