diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-30 20:06:17 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-30 20:06:17 +0200 |
commit | 8d797fc62e149cf2198a4815c473ec43a6db9245 (patch) | |
tree | f54615209dc4e4fac5b7ff9debb81fc13a130c12 /Libraries/LibHTML/CSS/StyleRule.h | |
parent | ac20919b13f82ea9f8d59fe1f34054b7060a96df (diff) | |
download | serenity-8d797fc62e149cf2198a4815c473ec43a6db9245.zip |
LibHTML: Fix incorrect CSS object model
A StyleRule has a StyleDeclaration which has many StyleProperty. :^)
Diffstat (limited to 'Libraries/LibHTML/CSS/StyleRule.h')
-rw-r--r-- | Libraries/LibHTML/CSS/StyleRule.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Libraries/LibHTML/CSS/StyleRule.h b/Libraries/LibHTML/CSS/StyleRule.h index 3ccdb57caa..a2f4c3a32b 100644 --- a/Libraries/LibHTML/CSS/StyleRule.h +++ b/Libraries/LibHTML/CSS/StyleRule.h @@ -6,26 +6,19 @@ class StyleRule : public RefCounted<StyleRule> { public: - static NonnullRefPtr<StyleRule> create(Vector<Selector>&& selectors, NonnullRefPtrVector<StyleDeclaration>&& declarations) + static NonnullRefPtr<StyleRule> create(Vector<Selector>&& selectors, NonnullRefPtr<StyleDeclaration>&& declaration) { - return adopt(*new StyleRule(move(selectors), move(declarations))); + return adopt(*new StyleRule(move(selectors), move(declaration))); } ~StyleRule(); const Vector<Selector>& selectors() const { return m_selectors; } - const NonnullRefPtrVector<StyleDeclaration>& declarations() const { return m_declarations; } - - template<typename C> - void for_each_declaration(C callback) const - { - for (auto& declaration : m_declarations) - callback(declaration); - } + const StyleDeclaration& declaration() const { return m_declaration; } private: - StyleRule(Vector<Selector>&&, NonnullRefPtrVector<StyleDeclaration>&&); + StyleRule(Vector<Selector>&&, NonnullRefPtr<StyleDeclaration>&&); Vector<Selector> m_selectors; - NonnullRefPtrVector<StyleDeclaration> m_declarations; + NonnullRefPtr<StyleDeclaration> m_declaration; }; |