1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:57:35 +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

@ -307,13 +307,12 @@ bool property_accepts_value(PropertyID property_id, StyleValue& style_value)
)~~~");
} else if (type_name == "length") {
property_generator.append(R"~~~(
if ((style_value.has_length() && !style_value.to_length().is_percentage()) || style_value.is_calculated())
if (style_value.has_length() || style_value.is_calculated())
return true;
)~~~");
} else if (type_name == "percentage") {
// FIXME: Detecting lengths here is temporary until Length/Percentage are fully separated.
property_generator.append(R"~~~(
if (style_value.is_percentage() || style_value.is_calculated() || (style_value.has_length() && !style_value.to_length().is_percentage()))
if (style_value.is_percentage() || style_value.is_calculated())
return true;
)~~~");
} else if (type_name == "number" || type_name == "integer") {