stylo: Add basic system font support, use for font-size and font-family

This commit is contained in:
Manish Goregaokar 2017-03-21 20:38:12 -07:00 committed by Manish Goregaokar
parent 2b5c17c43a
commit c1c4c8fa59
9 changed files with 261 additions and 11 deletions

View file

@ -409,7 +409,7 @@ impl AnimationValue {
}
/// Construct an AnimationValue from a property declaration
pub fn from_declaration(decl: &PropertyDeclaration, context: &Context, initial: &ComputedValues) -> Option<Self> {
pub fn from_declaration(decl: &PropertyDeclaration, context: &mut Context, initial: &ComputedValues) -> Option<Self> {
use error_reporting::StdoutErrorReporter;
use properties::LonghandId;
use properties::DeclaredValue;
@ -418,6 +418,11 @@ impl AnimationValue {
% for prop in data.longhands:
% if prop.animatable:
PropertyDeclaration::${prop.camel_case}(ref val) => {
% if prop.ident in "font_size font_family".split() and product == "gecko":
if let Some(sf) = val.get_system() {
longhands::system_font::resolve_system_font(sf, context);
}
% endif
Some(AnimationValue::${prop.camel_case}(val.to_computed_value(context)))
},
% endif