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

LibWeb: Fix logic issue when parsing CSS custom properties

With best wishes from De Morgan, this is the correct way to check
whether the string isn't of the form "var(...)".
This commit is contained in:
Tobias Christiansen 2021-06-09 21:31:13 +02:00 committed by Andreas Kling
parent b54bfdd696
commit 6d3361f077

View file

@ -219,7 +219,7 @@ static bool takes_integer_value(CSS::PropertyID property_id)
static StringView parse_custom_property_name(const StringView& value)
{
if (!value.starts_with("var(") && !value.ends_with(")"))
if (!value.starts_with("var(") || !value.ends_with(")"))
return {};
// FIXME: Allow for fallback
auto first_comma_index = value.find_first_of(",");