mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb: Prevent infinitely growing font size due to rem units in root
A font-size with rem units need to resolve against the default font metrics for the root element, otherwise every time we compute style, the reference value for rem units grows. This fixes an issue where text on some web pages would grow every time there was a relayout. This was very noticeable on https://proton.me/ Fixes #339
This commit is contained in:
parent
dd78d5d50e
commit
02a642b87b
Notes:
github-actions[bot]
2025-03-05 21:47:05 +00:00
Author: https://github.com/awesomekling
Commit: 02a642b87b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3821
5 changed files with 45 additions and 8 deletions
|
@ -631,7 +631,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_inherited_style()
|
|||
return invalidation;
|
||||
|
||||
document().style_computer().compute_font(*computed_properties, this, {});
|
||||
document().style_computer().absolutize_values(*computed_properties);
|
||||
document().style_computer().absolutize_values(*computed_properties, this);
|
||||
|
||||
for (auto [property_id, old_value] : old_values_with_relative_units) {
|
||||
auto new_value = computed_properties->maybe_null_property(static_cast<CSS::PropertyID>(property_id));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue