style: remove shorthand/serialize.mako.rs.

Bug: 1468651
Reviewed-by: heycam
MozReview-Commit-ID: 8Xyep2Q7trR
This commit is contained in:
Emilio Cobos Álvarez 2018-06-13 15:31:05 -07:00
parent 3b90ddd5d1
commit 5c15c59f56
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 26 additions and 28 deletions

View file

@ -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<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" />

View file

@ -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(())
}