Skip to content

Truly independent web browser

LibWeb: Publish an animated font size at the size it already has

Andreas Klingba74fef4951a
diff --git a/Libraries/LibWeb/Rust/src/css/style/style_invalidation.rs b/Libraries/LibWeb/Rust/src/css/style/style_invalidation.rs
index 63bc8f8836c..c8040e39aa8 100644
--- a/Libraries/LibWeb/Rust/src/css/style/style_invalidation.rs
+++ b/Libraries/LibWeb/Rust/src/css/style/style_invalidation.rs
@@ -820,6 +820,14 @@ pub(crate) fn animation_overlay_changed(
return true;
}
+ // NB: Whether an animation gives an element its font size matters beyond the value: a monospace element below it
+ // goes on from that size rather than from what the font-size cascade decides.
+ let animates_font_size =
+ |overlay: Option<&AnimatedOverlay>| longhands.overlay_value(overlay, property_id::FONT_SIZE).is_some();
+ if animates_font_size(old_overlay) != animates_font_size(new_overlay) {
+ return true;
+ }
+
animation_overlay_properties(old_overlay, new_overlay)
.any(|property| animation_value_changed(longhands, old_overlay, new_overlay, property))
}
diff --git a/Tests/LibWeb/Text/expected/css/monospace-follows-animated-ancestor-font-past-its-delay.txt b/Tests/LibWeb/Text/expected/css/monospace-follows-animated-ancestor-font-past-its-delay.txt
index 46917108964..0e4e8a3d46d 100644
--- a/Tests/LibWeb/Text/expected/css/monospace-follows-animated-ancestor-font-past-its-delay.txt
+++ b/Tests/LibWeb/Text/expected/css/monospace-follows-animated-ancestor-font-past-its-delay.txt
@@ -1,6 +1,6 @@
no animation: 16px, monospace 13px, ::before 13px, added 13px
in its delay, at the ancestor's size: 16px, monospace 13px, ::before 13px, added 13px
-past its delay, at the ancestor's size: 16px, monospace 13px, ::before 13px, added 13px
+past its delay, at the ancestor's size: 16px, monospace 16px, ::before 16px, added 16px
canceled: 16px, monospace 13px, ::before 13px, added 13px
in its delay, at another size: 16px, monospace 13px, ::before 13px, added 13px
past its delay, at another size: 20px, monospace 20px, ::before 20px, added 20px