servo: Merge #16853 - Fix serialization of font-feature-settings (from upsuper:font-feature-settings-serialization); r=emilio
authorXidorn Quan <me@upsuper.org>
Sat, 13 May 2017 23:56:25 -0500
changeset 406347 1a87940c0773f40b9e2349c52eadd8fdb8d74be8
parent 406346 101baa39a4551492262b3ed2c5d6f967d79ab4f4
child 406348 cf287e42cf707aa4be2ff03f22bbea5765613c4f
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs16853
milestone55.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
servo: Merge #16853 - Fix serialization of font-feature-settings (from upsuper:font-feature-settings-serialization); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: dab2df356594bf89502fc5934d8c16a57e3fdf45
servo/components/style/properties/longhand/font.mako.rs
--- a/servo/components/style/properties/longhand/font.mako.rs
+++ b/servo/components/style/properties/longhand/font.mako.rs
@@ -1834,25 +1834,26 @@ macro_rules! exclusive_value {
                 }
             }
         }
 
         impl ToCss for FeatureTagValue {
             fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
                 use std::str;
                 use byteorder::{WriteBytesExt, BigEndian};
+                use cssparser::serialize_string;
 
                 let mut raw: Vec<u8> = vec!();
                 raw.write_u32::<BigEndian>(self.tag).unwrap();
-                let str_print = str::from_utf8(&raw).unwrap_or_default();
+                serialize_string(str::from_utf8(&raw).unwrap_or_default(), dest)?;
 
                 match self.value {
-                    1 => write!(dest, "\"{}\"", str_print),
-                    0 => write!(dest, "\"{}\" off",str_print),
-                    x => write!(dest, "\"{}\" {}", str_print, x)
+                    1 => Ok(()),
+                    0 => dest.write_str(" off"),
+                    x => write!(dest, " {}", x)
                 }
             }
         }
 
         impl Parse for FeatureTagValue {
             /// https://www.w3.org/TR/css-fonts-3/#propdef-font-feature-settings
             /// <string> [ on | off | <integer> ]
             fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {