Browse Source

LibWeb: Add better debug logging for CSS parsing errors

Hidden behind `CSS_PARSER_DEBUG`, so I won't drive everyone else crazy.
:^)
Sam Atkins 3 years ago
parent
commit
35eb8b0dc2
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

+ 6 - 2
Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

@@ -1282,8 +1282,12 @@ Optional<StyleProperty> Parser::convert_to_style_property(StyleDeclarationRule&
     auto value_token_stream = TokenStream(declaration.m_values);
     auto value = parse_css_value(property_id, value_token_stream);
     if (value.is_error()) {
-        if (value.error() != ParsingResult::IncludesIgnoredVendorPrefix)
-            dbgln("Unable to parse value for CSS property '{}'", property_name);
+        if (value.error() != ParsingResult::IncludesIgnoredVendorPrefix) {
+            dbgln("Unable to parse value for CSS property '{}'.", property_name);
+            if constexpr (CSS_PARSER_DEBUG) {
+                value_token_stream.dump_all_tokens();
+            }
+        }
         return {};
     }