| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 unsigned m_containsAttributeSelector : 1; | 70 unsigned m_containsAttributeSelector : 1; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 struct SameSizeAsRuleData { | 73 struct SameSizeAsRuleData { |
| 74 void* a; | 74 void* a; |
| 75 unsigned b; | 75 unsigned b; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_s
tay_small); | 78 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_s
tay_small); |
| 79 | 79 |
| 80 class RuleSet : public DummyBase<RuleSet> { | 80 class RuleSet { |
| 81 WTF_MAKE_NONCOPYABLE(RuleSet); | 81 WTF_MAKE_NONCOPYABLE(RuleSet); |
| 82 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 82 WTF_MAKE_FAST_ALLOCATED; |
| 83 public: | 83 public: |
| 84 static PassOwnPtr<RuleSet> create() { return adoptPtr(new RuleSet); } | 84 static PassOwnPtr<RuleSet> create() { return adoptPtr(new RuleSet); } |
| 85 | 85 |
| 86 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR
uleFlags = RuleHasNoSpecialState); | 86 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR
uleFlags = RuleHasNoSpecialState); |
| 87 void addStyleRule(StyleRule*, AddRuleFlags); | 87 void addStyleRule(StyleRule*, AddRuleFlags); |
| 88 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags); | 88 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags); |
| 89 | 89 |
| 90 const RuleFeatureSet& features() const { return m_features; } | 90 const RuleFeatureSet& features() const { return m_features; } |
| 91 | 91 |
| 92 const TerminatedArray<RuleData>* idRules(const AtomicString& key) const { AS
SERT(!m_pendingRules); return m_idRules.get(key); } | 92 const TerminatedArray<RuleData>* idRules(const AtomicString& key) const { AS
SERT(!m_pendingRules); return m_idRules.get(key); } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void addToRuleSet(const AtomicString& key, PendingRuleMap&, const RuleData&)
; | 125 void addToRuleSet(const AtomicString& key, PendingRuleMap&, const RuleData&)
; |
| 126 void addFontFaceRule(StyleRuleFontFace*); | 126 void addFontFaceRule(StyleRuleFontFace*); |
| 127 void addKeyframesRule(StyleRuleKeyframes*); | 127 void addKeyframesRule(StyleRuleKeyframes*); |
| 128 | 128 |
| 129 void addChildRules(const Vector<RefPtr<StyleRuleBase> >&, const MediaQueryEv
aluator& medium, AddRuleFlags); | 129 void addChildRules(const Vector<RefPtr<StyleRuleBase> >&, const MediaQueryEv
aluator& medium, AddRuleFlags); |
| 130 bool findBestRuleSetAndAdd(const CSSSelector&, RuleData&); | 130 bool findBestRuleSetAndAdd(const CSSSelector&, RuleData&); |
| 131 | 131 |
| 132 void compactRules(); | 132 void compactRules(); |
| 133 static void compactPendingRules(PendingRuleMap&, CompactRuleMap&); | 133 static void compactPendingRules(PendingRuleMap&, CompactRuleMap&); |
| 134 | 134 |
| 135 class PendingRuleMaps : public DummyBase<PendingRuleMaps> { | 135 class PendingRuleMaps { |
| 136 public: | 136 public: |
| 137 static PassOwnPtr<PendingRuleMaps> create() { return adoptPtr(new Pendin
gRuleMaps); } | 137 static PassOwnPtr<PendingRuleMaps> create() { return adoptPtr(new Pendin
gRuleMaps); } |
| 138 | 138 |
| 139 PendingRuleMap idRules; | 139 PendingRuleMap idRules; |
| 140 PendingRuleMap classRules; | 140 PendingRuleMap classRules; |
| 141 PendingRuleMap tagRules; | 141 PendingRuleMap tagRules; |
| 142 PendingRuleMap shadowPseudoElementRules; | 142 PendingRuleMap shadowPseudoElementRules; |
| 143 | 143 |
| 144 void trace(Visitor*); | 144 void trace(Visitor*); |
| 145 | 145 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 171 #ifndef NDEBUG | 171 #ifndef NDEBUG |
| 172 Vector<RuleData> m_allRules; | 172 Vector<RuleData> m_allRules; |
| 173 #endif | 173 #endif |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 } // namespace blink | 176 } // namespace blink |
| 177 | 177 |
| 178 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); | 178 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); |
| 179 | 179 |
| 180 #endif // RuleSet_h | 180 #endif // RuleSet_h |
| OLD | NEW |