From ef0613ea4c082c5843b8533c956cbab0b40931ab Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Oct 2019 11:43:38 +0200 Subject: [PATCH] LibHTML: Unbreak parsing of standalone declarations Oops, I forgot to update CSSParser::parse_standalone_declaration() after making parse_property() return a property (or {} for failure.) --- Libraries/LibHTML/Parser/CSSParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/LibHTML/Parser/CSSParser.cpp b/Libraries/LibHTML/Parser/CSSParser.cpp index 77df32ae2d..11c90a6f1e 100644 --- a/Libraries/LibHTML/Parser/CSSParser.cpp +++ b/Libraries/LibHTML/Parser/CSSParser.cpp @@ -215,7 +215,9 @@ public: consume_whitespace(); is_important = true; } - consume_specific(';'); + if (peek() != '}') + consume_specific(';'); + return StyleProperty { property_name, parse_css_value(property_value), is_important }; } @@ -254,7 +256,9 @@ public: { consume_whitespace(); for (;;) { - parse_property(); + auto property = parse_property(); + if (property.has_value()) + current_rule.properties.append(property.value()); consume_whitespace(); if (!peek()) break;