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
commit cff44831a8
Notes: sideshowbarker 2024-07-17 20:36:12 +09:00
5 changed files with 3 additions and 19 deletions

View file

@ -2184,12 +2184,7 @@ Optional<Length> Parser::parse_length(StyleComponentValueRule const& component_v
if (dimension->is_length())
return dimension->length();
// FIXME: This is a temporary hack until Length is split up fully.
if (dimension->is_percentage()) {
auto percentage = dimension->percentage();
return Length { (float)percentage.value(), Length::Type::Percentage };
}
// FIXME: auto isn't a length!
if (component_value.is(Token::Type::Ident) && component_value.token().ident().equals_ignoring_case("auto"))
return Length::make_auto();