Skip to content

Commit

Permalink
Auto merge of #16853 - upsuper:font-feature-settings-serialization, r…
Browse files Browse the repository at this point in the history
…=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 -->
  • Loading branch information
bors-servo committed May 14, 2017
2 parents 320cfeb + 7d37804 commit dab2df3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/style/properties/longhand/font.mako.rs
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit dab2df3

Please sign in to comment.