aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-05-13 23:56:25 -0500
committerGitHub <noreply@github.com>2017-05-13 23:56:25 -0500
commitdab2df356594bf89502fc5934d8c16a57e3fdf45 (patch)
tree121223fe0a95ed49e48d774efbf27dd7f7818950
parent320cfeb2909ff061552194f02147f4b50b6a1450 (diff)
parent7d37804eac542f140b65d62987f52db214647561 (diff)
downloadservo-dab2df356594bf89502fc5934d8c16a57e3fdf45.tar.gz
servo-dab2df356594bf89502fc5934d8c16a57e3fdf45.zip
Auto merge of #16853 - upsuper:font-feature-settings-serialization, r=emilio
Fix serialization of font-feature-settings <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16853) <!-- Reviewable:end -->
-rw-r--r--components/style/properties/longhand/font.mako.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs
index 86f4666b322..2b5c89b958f 100644
--- a/components/style/properties/longhand/font.mako.rs
+++ b/components/style/properties/longhand/font.mako.rs
@@ -1839,15 +1839,16 @@ ${helpers.single_keyword_system("font-variant-position",
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)
}
}
}