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

LibWeb: Verify we don't accidentally create an auto LengthStyleValue

This commit is contained in:
Sam Atkins 2023-04-17 20:30:49 +01:00 committed by Andreas Kling
parent e3b557fa64
commit 4ddacf4740

View file

@ -13,10 +13,7 @@ namespace Web::CSS {
ValueComparingNonnullRefPtr<LengthStyleValue> LengthStyleValue::create(Length const& length)
{
if (length.is_auto()) {
static auto value = adopt_ref(*new LengthStyleValue(CSS::Length::make_auto()));
return value;
}
VERIFY(!length.is_auto());
if (length.is_px()) {
if (length.raw_value() == 0) {
static auto value = adopt_ref(*new LengthStyleValue(CSS::Length::make_px(0)));