diff options
author | Tobias Christiansen <tobi@tobyase.de> | 2021-06-09 21:31:13 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-09 21:50:22 +0200 |
commit | 6d3361f077841ca701e287cd0caf5b5eee29ee29 (patch) | |
tree | db25dbcd814fda6ecb39fffd5ecc9b032b6d149d /Userland/Libraries/LibWeb | |
parent | b54bfdd6961a213a911822c3faece82e3a1caf4d (diff) | |
download | serenity-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.cpp | 2 |
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(","); |