From 30711f43a6cad9889ee1af8539658c4ca1f59854 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 5 Dec 2014 16:09:53 +0100 Subject: Further work on implementing CSSRuleSets. This needs further testing, though. --- src/core/CSS.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/core/CSS.hpp') diff --git a/src/core/CSS.hpp b/src/core/CSS.hpp index 3b4289a..4cf15be 100644 --- a/src/core/CSS.hpp +++ b/src/core/CSS.hpp @@ -70,17 +70,24 @@ struct Specificity { */ class RuleSet : public Managed { private: - const std::map values; + std::map rules; public: /** * Initializes an empty RuleSet. */ - RuleSet(Manager &mgr) : Managed(mgr), values() {} + RuleSet(Manager &mgr) : Managed(mgr), rules() {} - const std::map &getValues() const + std::map &getRules() { return rules; } + + const std::map &getRules() const { - return values; + return rules; + } + + void merge(Rooted other) + { + rules.insert(other->rules.begin(), other->rules.end()); } }; @@ -244,7 +251,7 @@ private: const PseudoSelector pseudoSelector; ManagedVector edges; Owned ruleSet; - bool accepting; + bool accepting = false; /** * This is an internal method all getChildren variants refer to. @@ -254,7 +261,6 @@ private: const PseudoSelector *select); public: - /** * This initializes an empty SelectorNode with the given name and the * given PseudoSelector. -- cgit v1.2.3