From 7d37804eac542f140b65d62987f52db214647561 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Sat, 13 May 2017 22:53:33 +1000 Subject: [PATCH] Fix serialization of font-feature-settings --- components/style/properties/longhand/font.mako.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index 6691603499f..b13a783b583 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -1838,15 +1838,16 @@ ${helpers.single_keyword_system("font-variant-position", fn to_css(&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 = vec!(); raw.write_u32::(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) } } }