mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix serialization of font-feature-settings
This commit is contained in:
parent
d2fa2ae934
commit
7d37804eac
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue