mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
parent
5f5fe2ca52
commit
bf16836598
2 changed files with 12 additions and 968 deletions
|
@ -19,7 +19,8 @@
|
|||
impl NoViewportPercentage for SpecifiedValue {}
|
||||
|
||||
pub mod computed_value {
|
||||
use std::fmt;
|
||||
use cssparser::CssStringWriter;
|
||||
use std::fmt::{self, Write};
|
||||
use Atom;
|
||||
use style_traits::ToCss;
|
||||
pub use self::FontFamily as SingleComputedValue;
|
||||
|
@ -72,7 +73,16 @@
|
|||
|
||||
impl ToCss for FontFamily {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
self.atom().with_str(|s| dest.write_str(s))
|
||||
match *self {
|
||||
FontFamily::FamilyName(ref name) => {
|
||||
dest.write_char('"')?;
|
||||
write!(CssStringWriter::new(dest), "{}", name)?;
|
||||
dest.write_char('"')
|
||||
}
|
||||
|
||||
// All generic values accepted by the parser are known to not require escaping.
|
||||
FontFamily::Generic(ref name) => write!(dest, "{}", name),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue