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

LibWeb: Always inline absolute Length to_px() conversion

Only do the relative Length units out of line.
This commit is contained in:
Andreas Kling 2020-06-23 23:21:58 +02:00
parent 5f0a1ef21b
commit ae181e1573
2 changed files with 16 additions and 6 deletions

View file

@ -30,13 +30,9 @@
namespace Web {
float Length::to_px(const LayoutNode& layout_node) const
float Length::relative_length_to_px(const LayoutNode& layout_node) const
{
switch (m_type) {
case Type::Auto:
return 0;
case Type::Px:
return m_value;
case Type::Em:
return m_value * layout_node.font_size();
case Type::Rem: