summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML/CSS/StyleRule.h
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/CSS/StyleRule.h
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/CSS/StyleRule.h')
-rw-r--r--Libraries/LibHTML/CSS/StyleRule.h17
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;
};