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
commit 6d3361f077
Notes: sideshowbarker 2024-07-18 12:31:26 +09:00

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(",");