Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Stop asserting when cached system font changes
It may change during animation
  • Loading branch information
Manishearth committed Jul 20, 2017
1 parent e19fefc commit 5f7d043
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/style/properties/longhand/font.mako.rs
Expand Up @@ -2489,11 +2489,13 @@ ${helpers.single_keyword("-moz-math-variant",
/// Must be called before attempting to compute a system font
/// specified value
pub fn resolve_system_font(system: SystemFont, context: &mut Context) {
if context.cached_system_font.is_none() {
// Checking if context.cached_system_font.is_none() isn't enough,
// if animating from one system font to another the cached system font
// may change
if Some(system) != context.cached_system_font.as_ref().map(|x| x.system_font) {
let computed = system.to_computed_value(context);
context.cached_system_font = Some(computed);
}
debug_assert!(system == context.cached_system_font.as_ref().unwrap().system_font)
}

#[derive(Clone, Debug)]
Expand Down

0 comments on commit 5f7d043

Please sign in to comment.