mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Account for animated values when computing font
Computing the font for an element in `compute_font` is premature since we are yet to apply animated properties - instead we should compute the value on the fly (with a cache to avoid unnecessary work) to ensure we are respecting the latest values
This commit is contained in:
Notes:
github-actions[bot]
2025-12-05 10:04:25 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/dca80ad5ebb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6757 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/gmta
@@ -152,7 +152,7 @@ void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style)
|
||||
// NOTE: Other browsers apply a minimum height of a single line's line-height to single-line input elements.
|
||||
if (is_single_line() && style.property(CSS::PropertyID::Height).has_auto()) {
|
||||
auto current_line_height = style.line_height().to_double();
|
||||
auto minimum_line_height = style.first_available_computed_font().pixel_size() * CSS::ComputedProperties::normal_line_height_scale;
|
||||
auto minimum_line_height = style.first_available_computed_font(document().font_computer())->pixel_size() * CSS::ComputedProperties::normal_line_height_scale;
|
||||
|
||||
// FIXME: Instead of overriding line-height, we should set height here instead.
|
||||
if (current_line_height < minimum_line_height)
|
||||
|
||||
Reference in New Issue
Block a user