mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Bug 1349417 - Part 8: stylo: Serialize system fonts correctly; r?xidorn
MozReview-Commit-ID: 4q1zZUcw6zF
This commit is contained in:
parent
681df60191
commit
59f16b57e7
2 changed files with 54 additions and 0 deletions
|
@ -2103,7 +2103,9 @@ ${helpers.single_keyword("-moz-math-variant",
|
|||
use app_units::Au;
|
||||
use cssparser::Parser;
|
||||
use properties::longhands;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use style_traits::ToCss;
|
||||
use values::computed::{ToComputedValue, Context};
|
||||
<%
|
||||
system_fonts = """caption icon menu message-box small-caption status-bar
|
||||
|
@ -2124,6 +2126,16 @@ ${helpers.single_keyword("-moz-math-variant",
|
|||
% endfor
|
||||
}
|
||||
|
||||
impl ToCss for SystemFont {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
dest.write_str(match *self {
|
||||
% for font in system_fonts:
|
||||
SystemFont::${to_camel_case(font)} => "${font}",
|
||||
% endfor
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// ComputedValues are compared at times
|
||||
// so we need these impls. We don't want to
|
||||
// add Eq to Number (which contains a float)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue