mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +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
|
@ -2104,4 +2104,9 @@ CSSPixels ComputedProperties::font_size() const
|
|||
return property(PropertyID::FontSize).as_length().length().absolute_length_to_px();
|
||||
}
|
||||
|
||||
double ComputedProperties::font_weight() const
|
||||
{
|
||||
return property(PropertyID::FontWeight).as_number().number();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue