OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 AddRuleFlags m_flags; | 64 AddRuleFlags m_flags; |
65 }; | 65 }; |
66 | 66 |
67 class RuleData { | 67 class RuleData { |
68 WTF_MAKE_FAST_ALLOCATED; | 68 WTF_MAKE_FAST_ALLOCATED; |
69 public: | 69 public: |
70 RuleData(StyleRule*, unsigned selectorIndex, unsigned position, AddRuleFlags
); | 70 RuleData(StyleRule*, unsigned selectorIndex, unsigned position, AddRuleFlags
); |
71 | 71 |
72 unsigned position() const { return m_position; } | 72 unsigned position() const { return m_position; } |
73 StyleRule* rule() const { return m_rule; } | 73 StyleRule* rule() const { return m_rule; } |
74 const CSSSelector* selector() const { return m_rule->selectorList().selector
At(m_selectorIndex); } | 74 const CSSSelector& selector() const { return m_rule->selectorList().selector
At(m_selectorIndex); } |
75 unsigned selectorIndex() const { return m_selectorIndex; } | 75 unsigned selectorIndex() const { return m_selectorIndex; } |
76 | 76 |
77 bool isLastInArray() const { return m_isLastInArray; } | 77 bool isLastInArray() const { return m_isLastInArray; } |
78 void setLastInArray(bool flag) { m_isLastInArray = flag; } | 78 void setLastInArray(bool flag) { m_isLastInArray = flag; } |
79 | 79 |
80 bool hasFastCheckableSelector() const { return m_hasFastCheckableSelector; } | 80 bool hasFastCheckableSelector() const { return m_hasFastCheckableSelector; } |
81 bool hasMultipartSelector() const { return m_hasMultipartSelector; } | 81 bool hasMultipartSelector() const { return m_hasMultipartSelector; } |
82 bool hasRightmostSelectorMatchingHTMLBasedOnRuleHash() const { return m_hasR
ightmostSelectorMatchingHTMLBasedOnRuleHash; } | 82 bool hasRightmostSelectorMatchingHTMLBasedOnRuleHash() const { return m_hasR
ightmostSelectorMatchingHTMLBasedOnRuleHash; } |
83 bool containsUncommonAttributeSelector() const { return m_containsUncommonAt
tributeSelector; } | 83 bool containsUncommonAttributeSelector() const { return m_containsUncommonAt
tributeSelector; } |
84 unsigned specificity() const { return m_specificity; } | 84 unsigned specificity() const { return m_specificity; } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 | 174 |
175 void addToRuleSet(StringImpl* key, PendingRuleMap&, const RuleData&); | 175 void addToRuleSet(StringImpl* key, PendingRuleMap&, const RuleData&); |
176 void addPageRule(StyleRulePage*); | 176 void addPageRule(StyleRulePage*); |
177 void addViewportRule(StyleRuleViewport*); | 177 void addViewportRule(StyleRuleViewport*); |
178 void addFontFaceRule(StyleRuleFontFace*); | 178 void addFontFaceRule(StyleRuleFontFace*); |
179 void addKeyframesRule(StyleRuleKeyframes*); | 179 void addKeyframesRule(StyleRuleKeyframes*); |
180 void addRegionRule(StyleRuleRegion*, bool hasDocumentSecurityOrigin); | 180 void addRegionRule(StyleRuleRegion*, bool hasDocumentSecurityOrigin); |
181 | 181 |
182 void addChildRules(const Vector<RefPtr<StyleRuleBase> >&, const MediaQueryEv
aluator& medium, AddRuleFlags); | 182 void addChildRules(const Vector<RefPtr<StyleRuleBase> >&, const MediaQueryEv
aluator& medium, AddRuleFlags); |
183 bool findBestRuleSetAndAdd(const CSSSelector*, RuleData&); | 183 bool findBestRuleSetAndAdd(const CSSSelector&, RuleData&); |
184 | 184 |
185 void compactRules(); | 185 void compactRules(); |
186 static void compactPendingRules(PendingRuleMap&, CompactRuleMap&); | 186 static void compactPendingRules(PendingRuleMap&, CompactRuleMap&); |
187 | 187 |
188 struct PendingRuleMaps { | 188 struct PendingRuleMaps { |
189 PendingRuleMap idRules; | 189 PendingRuleMap idRules; |
190 PendingRuleMap classRules; | 190 PendingRuleMap classRules; |
191 PendingRuleMap tagRules; | 191 PendingRuleMap tagRules; |
192 PendingRuleMap shadowPseudoElementRules; | 192 PendingRuleMap shadowPseudoElementRules; |
193 }; | 193 }; |
(...skipping 23 matching lines...) Expand all Loading... |
217 | 217 |
218 MediaQueryResultList m_viewportDependentMediaQueryResults; | 218 MediaQueryResultList m_viewportDependentMediaQueryResults; |
219 | 219 |
220 unsigned m_ruleCount; | 220 unsigned m_ruleCount; |
221 OwnPtr<PendingRuleMaps> m_pendingRules; | 221 OwnPtr<PendingRuleMaps> m_pendingRules; |
222 }; | 222 }; |
223 | 223 |
224 } // namespace WebCore | 224 } // namespace WebCore |
225 | 225 |
226 #endif // RuleSet_h | 226 #endif // RuleSet_h |
OLD | NEW |