mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Stop asserting when cached system font changes
It may change during animation
This commit is contained in:
parent
e19fefcb47
commit
5f7d0436ab
1 changed files with 4 additions and 2 deletions
|
@ -2489,11 +2489,13 @@ ${helpers.single_keyword("-moz-math-variant",
|
||||||
/// Must be called before attempting to compute a system font
|
/// Must be called before attempting to compute a system font
|
||||||
/// specified value
|
/// specified value
|
||||||
pub fn resolve_system_font(system: SystemFont, context: &mut Context) {
|
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);
|
let computed = system.to_computed_value(context);
|
||||||
context.cached_system_font = Some(computed);
|
context.cached_system_font = Some(computed);
|
||||||
}
|
}
|
||||||
debug_assert!(system == context.cached_system_font.as_ref().unwrap().system_font)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue