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

LibWeb: Remove Length::Type::Percentage :^)

All `<percentage>`s in the CSS grammar are now represented by the
`Percentage` class, and `<length-percentage>` by `LengthPercentage`.
This commit is contained in:
Sam Atkins 2022-01-19 16:40:01 +00:00 committed by Andreas Kling
parent 5e9a6302e5
commit cff44831a8
5 changed files with 3 additions and 19 deletions

View file

@ -55,8 +55,6 @@ Length Length::resolved(const Length& fallback_for_undefined, const Layout::Node
return fallback_for_undefined;
if (is_calculated())
return Length(resolve_calculated_value(layout_node, reference_for_percent), Type::Px);
if (is_percentage())
return make_px(raw_value() / 100.0f * reference_for_percent);
if (is_relative())
return make_px(to_px(layout_node));
return *this;
@ -257,8 +255,6 @@ const char* Length::unit_name() const
return "rem";
case Type::Auto:
return "auto";
case Type::Percentage:
return "%";
case Type::Undefined:
return "undefined";
case Type::Vh: