mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 00:49:46 +00:00
LibWeb: Store font-weight in ComputedProperties in computed form
We now also more closely follow the spec when computing values for font-weight and we now: - Support relative lengths in `calc()`s - Properly clamp `calc()`s - Support relative keywords (e.g. lighter, bolder) - Respect that font-weight can be a non-integer number. This does expose a few false positives in the font-weight-computed.html WPT test. This is because we don't recompute non-inherited font-weight within `recompute_inherited_style` which means that relative keyword values can fall out of sync with their parent's value. These previously passed as we treated `bolder` and `lighter` as aliases for `bold` and `normal` respectively.
This commit is contained in:
parent
cfbe0244d4
commit
39484e2027
Notes:
github-actions[bot]
2025-09-19 09:08:40 +00:00
Author: https://github.com/Calme1709
Commit: 39484e2027
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6072
Reviewed-by: https://github.com/AtkinsSJ ✅
15 changed files with 214 additions and 117 deletions
|
|
@ -814,6 +814,9 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_inherited_style()
|
|||
computed_properties->set_property(property_id, *preabsolutized_value, is_inherited ? CSS::ComputedProperties::Inherited::Yes : CSS::ComputedProperties::Inherited::No);
|
||||
old_values_with_relative_units.set(i, old_value);
|
||||
}
|
||||
|
||||
// FIXME: We should also consider properties which depend on their inherited values for computation (e.g.
|
||||
// relative font-sizes or font-weights)
|
||||
if (!computed_properties->is_property_inherited(property_id))
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue