summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML/Parser
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-30 20:06:17 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-30 20:06:17 +0200
commit8d797fc62e149cf2198a4815c473ec43a6db9245 (patch)
treef54615209dc4e4fac5b7ff9debb81fc13a130c12 /Libraries/LibHTML/Parser
parentac20919b13f82ea9f8d59fe1f34054b7060a96df (diff)
downloadserenity-8d797fc62e149cf2198a4815c473ec43a6db9245.zip
LibHTML: Fix incorrect CSS object model
A StyleRule has a StyleDeclaration which has many StyleProperty. :^)
Diffstat (limited to 'Libraries/LibHTML/Parser')
-rw-r--r--Libraries/LibHTML/Parser/CSSParser.cpp6
1 files changed, 3 insertions, 3 deletions
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<StyleSheet> parse_css(const String& css)
struct CurrentRule {
Vector<Selector> selectors;
- NonnullRefPtrVector<StyleDeclaration> declarations;
+ Vector<StyleProperty> properties;
};
CurrentRule current_rule;
@@ -146,7 +146,7 @@ NonnullRefPtr<StyleSheet> 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<StyleSheet> 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();
};