From 8d797fc62e149cf2198a4815c473ec43a6db9245 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 30 Sep 2019 20:06:17 +0200 Subject: LibHTML: Fix incorrect CSS object model A StyleRule has a StyleDeclaration which has many StyleProperty. :^) --- Libraries/LibHTML/Parser/CSSParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Libraries/LibHTML/Parser') diff --git a/Libraries/LibHTML/Parser/CSSParser.cpp b/Libraries/LibHTML/Parser/CSSParser.cpp index 4e821322c8..fa10068c98 100644 --- a/Libraries/LibHTML/Parser/CSSParser.cpp +++ b/Libraries/LibHTML/Parser/CSSParser.cpp @@ -50,7 +50,7 @@ NonnullRefPtr parse_css(const String& css) struct CurrentRule { Vector selectors; - NonnullRefPtrVector declarations; + Vector properties; }; CurrentRule current_rule; @@ -146,7 +146,7 @@ NonnullRefPtr parse_css(const String& css) auto property_value = String::copy(buffer); buffer.clear(); consume_specific(';'); - current_rule.declarations.append(StyleDeclaration::create(property_name, parse_css_value(property_value))); + current_rule.properties.append({ property_name, parse_css_value(property_value) }); }; auto parse_declarations = [&] { @@ -163,7 +163,7 @@ NonnullRefPtr parse_css(const String& css) consume_specific('{'); parse_declarations(); consume_specific('}'); - rules.append(StyleRule::create(move(current_rule.selectors), move(current_rule.declarations))); + rules.append(StyleRule::create(move(current_rule.selectors), StyleDeclaration::create(move(current_rule.properties)))); consume_whitespace(); }; -- cgit v1.2.3