summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorTobias Christiansen <tobi@tobyase.de>2021-06-09 21:31:13 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-09 21:50:22 +0200
commit6d3361f077841ca701e287cd0caf5b5eee29ee29 (patch)
treedb25dbcd814fda6ecb39fffd5ecc9b032b6d149d /Userland/Libraries/LibWeb
parentb54bfdd6961a213a911822c3faece82e3a1caf4d (diff)
downloadserenity-6d3361f077841ca701e287cd0caf5b5eee29ee29.zip
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(...)".
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp
index edca46cf77..cd48a1b2a0 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp
@@ -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(",");