Skip to content

Commit

Permalink
Fix serialization of font-feature-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed May 14, 2017
1 parent d2fa2ae commit 7d37804
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 @@ -1838,15 +1838,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 7d37804

Please sign in to comment.