author | Emilio Cobos Álvarez <emilio@crisal.io> |
Wed, 13 Jun 2018 15:31:05 -0700 | |
changeset 423140 | e3b98fb8b7131f4c77073f2d3c4a5cafe93be00b |
parent 423139 | 86ef0de352d228ef19cf5e69043d2433725e3501 |
child 423141 | 6b23758e71d03125e235132b2f25750f9a577800 |
push id | 34164 |
push user | csabou@mozilla.com |
push date | Thu, 21 Jun 2018 01:17:13 +0000 |
treeherder | mozilla-central@d231a3231680 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | heycam |
bugs | 1468651 |
milestone | 62.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
|
--- 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(()) -}