1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibWeb/CSS: Parser should treat calc() with flex values as invalid

Fixes crash on https://signal.org/
This commit is contained in:
Aliaksandr Kalenik 2023-10-10 22:54:07 +02:00 committed by Andreas Kling
parent 1132c858e9
commit 65b50ecc1a
3 changed files with 44 additions and 1 deletions

View file

@ -6476,8 +6476,14 @@ OwnPtr<CalculationNode> Parser::parse_a_calculation(Vector<ComponentValue> const
// FIXME: Resolutions, once calc() supports them.
else if (dimension->is_time())
values.append({ NumericCalculationNode::create(dimension->time()) });
else
else if (dimension->is_flex()) {
// https://www.w3.org/TR/css3-grid-layout/#fr-unit
// NOTE: <flex> values are not <length>s (nor are they compatible with <length>s, like some <percentage> values),
// so they cannot be represented in or combined with other unit types in calc() expressions.
return nullptr;
} else {
VERIFY_NOT_REACHED();
}
continue;
}