OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2002, 2006, 2012 Apple Computer, Inc. | 4 * Copyright (C) 2002, 2006, 2012 Apple Computer, Inc. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 virtual unsigned length() const = 0; | 42 virtual unsigned length() const = 0; |
43 virtual CSSRule* item(unsigned index) const = 0; | 43 virtual CSSRule* item(unsigned index) const = 0; |
44 | 44 |
45 virtual CSSStyleSheet* styleSheet() const = 0; | 45 virtual CSSStyleSheet* styleSheet() const = 0; |
46 | 46 |
47 protected: | 47 protected: |
48 CSSRuleList(); | 48 CSSRuleList(); |
49 }; | 49 }; |
50 | 50 |
51 class StaticCSSRuleList : public CSSRuleList { | 51 class StaticCSSRuleList FINAL : public CSSRuleList { |
52 public: | 52 public: |
53 static PassRefPtr<StaticCSSRuleList> create() { return adoptRef(new StaticCS
SRuleList()); } | 53 static PassRefPtr<StaticCSSRuleList> create() { return adoptRef(new StaticCS
SRuleList()); } |
54 | 54 |
55 virtual void ref() { ++m_refCount; } | 55 virtual void ref() OVERRIDE { ++m_refCount; } |
56 virtual void deref(); | 56 virtual void deref() OVERRIDE; |
57 | 57 |
58 Vector<RefPtr<CSSRule> >& rules() { return m_rules; } | 58 Vector<RefPtr<CSSRule> >& rules() { return m_rules; } |
59 | 59 |
60 virtual CSSStyleSheet* styleSheet() const { return 0; } | 60 virtual CSSStyleSheet* styleSheet() const OVERRIDE { return 0; } |
61 | 61 |
62 private: | 62 private: |
63 StaticCSSRuleList(); | 63 StaticCSSRuleList(); |
64 ~StaticCSSRuleList(); | 64 virtual ~StaticCSSRuleList(); |
65 | 65 |
66 virtual unsigned length() const { return m_rules.size(); } | 66 virtual unsigned length() const OVERRIDE { return m_rules.size(); } |
67 virtual CSSRule* item(unsigned index) const { return index < m_rules.size()
? m_rules[index].get() : 0; } | 67 virtual CSSRule* item(unsigned index) const OVERRIDE { return index < m_rule
s.size() ? m_rules[index].get() : 0; } |
68 | 68 |
69 Vector<RefPtr<CSSRule> > m_rules; | 69 Vector<RefPtr<CSSRule> > m_rules; |
70 unsigned m_refCount; | 70 unsigned m_refCount; |
71 }; | 71 }; |
72 | 72 |
73 // The rule owns the live list. | 73 // The rule owns the live list. |
74 template <class Rule> | 74 template <class Rule> |
75 class LiveCSSRuleList : public CSSRuleList { | 75 class LiveCSSRuleList FINAL : public CSSRuleList { |
76 public: | 76 public: |
77 LiveCSSRuleList(Rule* rule) : m_rule(rule) { } | 77 LiveCSSRuleList(Rule* rule) : m_rule(rule) { } |
78 | 78 |
79 virtual void ref() { m_rule->ref(); } | 79 virtual void ref() OVERRIDE { m_rule->ref(); } |
80 virtual void deref() { m_rule->deref(); } | 80 virtual void deref() OVERRIDE { m_rule->deref(); } |
81 | 81 |
82 private: | 82 private: |
83 virtual unsigned length() const { return m_rule->length(); } | 83 virtual unsigned length() const OVERRIDE { return m_rule->length(); } |
84 virtual CSSRule* item(unsigned index) const { return m_rule->item(index); } | 84 virtual CSSRule* item(unsigned index) const OVERRIDE { return m_rule->item(i
ndex); } |
85 virtual CSSStyleSheet* styleSheet() const { return m_rule->parentStyleSheet(
); } | 85 virtual CSSStyleSheet* styleSheet() const OVERRIDE { return m_rule->parentSt
yleSheet(); } |
86 | 86 |
87 Rule* m_rule; | 87 Rule* m_rule; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace WebCore | 90 } // namespace WebCore |
91 | 91 |
92 #endif // CSSRuleList_h | 92 #endif // CSSRuleList_h |
OLD | NEW |