1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LibWeb: Handle non-px font sizes

The previous code assumed all font sizes were in px, but now we perform
the conversion. There is an existing bug with em sizes returning 0,
which seems to affect other places too - see
`NodeWithStyle::apply_style()`.

This also implements 'larger', 'smaller' and calc() font-sizes.
This commit is contained in:
Sam Atkins 2021-08-12 16:41:09 +01:00 committed by Andreas Kling
parent c990340c5a
commit 8c39fee34d
3 changed files with 28 additions and 14 deletions

View file

@ -219,7 +219,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
{
auto& computed_values = static_cast<CSS::MutableComputedValues&>(m_computed_values);
m_font = specified_style.font();
m_font = specified_style.font(*this);
m_line_height = specified_style.line_height(*this);
{