mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
stylo: Add basic system font support, use for font-size and font-family
This commit is contained in:
parent
2b5c17c43a
commit
c1c4c8fa59
9 changed files with 261 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue