From 66ad73993468807b8dff5367794acd66ebee1e59 Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Fri, 21 May 2021 19:37:21 +0200 Subject: [PATCH] LibWeb: Ignore vendor-specific CSS properties If we can't parse a property we previously a log-line was generated. However it is in our best interest to simply ignore vendor-specific properties (e.g -moz-something or -webkit-something) since they are not part of the spec. The vendor-specific-ness is determined by looking whether the property starts with '-'. If we want to support some vendor-specific stuff, this doesn't get in the way since this check takes place after the parser determined that the current property is invalid. This cuts down the log-noise of the parser. --- Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp index 244ba6c0cc..9706850d6e 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp @@ -793,7 +793,7 @@ public: } auto property_id = CSS::property_id_from_string(property_name); - if (property_id == CSS::PropertyID::Invalid) { + if (property_id == CSS::PropertyID::Invalid && !property_name.starts_with('-')) { dbgln("CSSParser: Unrecognized property '{}'", property_name); } auto value = parse_css_value(m_context, property_value, property_id);