From 5f7d0436ab87bcbdf8f1eb129c9b5c0ea4a11095 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 20 Jul 2017 15:06:44 -0700 Subject: [PATCH] Stop asserting when cached system font changes It may change during animation --- components/style/properties/longhand/font.mako.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index 39f611e7d02a..538ffe3b0438 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -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)]