Skip to content

Commit

Permalink
LibWeb: Fix logic issue when parsing CSS custom properties
Browse files Browse the repository at this point in the history
With best wishes from De Morgan, this is the correct way to check
whether the string isn't of the form "var(...)".
  • Loading branch information
TobyAsE authored and awesomekling committed Jun 9, 2021
1 parent b54bfdd commit 6d3361f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(",");
Expand Down

0 comments on commit 6d3361f

Please sign in to comment.