| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 PropertyWhitelistNone, | 46 PropertyWhitelistNone, |
| 47 PropertyWhitelistCue, | 47 PropertyWhitelistCue, |
| 48 PropertyWhitelistFirstLetter, | 48 PropertyWhitelistFirstLetter, |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class CSSSelector; | 51 class CSSSelector; |
| 52 class MediaQueryEvaluator; | 52 class MediaQueryEvaluator; |
| 53 class StyleSheetContents; | 53 class StyleSheetContents; |
| 54 | 54 |
| 55 class MinimalRuleData { | 55 class MinimalRuleData { |
| 56 ALLOW_ONLY_INLINE_ALLOCATION(); | 56 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 57 public: | 57 public: |
| 58 MinimalRuleData(StyleRule* rule, unsigned selectorIndex, AddRuleFlags flags) | 58 MinimalRuleData(StyleRule* rule, unsigned selectorIndex, AddRuleFlags flags) |
| 59 : m_rule(rule) | 59 : m_rule(rule) |
| 60 , m_selectorIndex(selectorIndex) | 60 , m_selectorIndex(selectorIndex) |
| 61 , m_flags(flags) | 61 , m_flags(flags) |
| 62 { | 62 { |
| 63 } | 63 } |
| 64 | 64 |
| 65 DECLARE_TRACE(); | 65 DECLARE_TRACE(); |
| 66 | 66 |
| 67 RawPtrWillBeMember<StyleRule> m_rule; | 67 RawPtrWillBeMember<StyleRule> m_rule; |
| 68 unsigned m_selectorIndex; | 68 unsigned m_selectorIndex; |
| 69 AddRuleFlags m_flags; | 69 AddRuleFlags m_flags; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 class CORE_EXPORT RuleData { | 72 class CORE_EXPORT RuleData { |
| 73 ALLOW_ONLY_INLINE_ALLOCATION(); | 73 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 74 public: | 74 public: |
| 75 RuleData(StyleRule*, unsigned selectorIndex, unsigned position, AddRuleFlags
); | 75 RuleData(StyleRule*, unsigned selectorIndex, unsigned position, AddRuleFlags
); |
| 76 | 76 |
| 77 unsigned position() const { return m_position; } | 77 unsigned position() const { return m_position; } |
| 78 StyleRule* rule() const { return m_rule; } | 78 StyleRule* rule() const { return m_rule; } |
| 79 const CSSSelector& selector() const { return m_rule->selectorList().selector
At(m_selectorIndex); } | 79 const CSSSelector& selector() const { return m_rule->selectorList().selector
At(m_selectorIndex); } |
| 80 unsigned selectorIndex() const { return m_selectorIndex; } | 80 unsigned selectorIndex() const { return m_selectorIndex; } |
| 81 | 81 |
| 82 bool isLastInArray() const { return m_isLastInArray; } | 82 bool isLastInArray() const { return m_isLastInArray; } |
| 83 void setLastInArray(bool flag) { m_isLastInArray = flag; } | 83 void setLastInArray(bool flag) { m_isLastInArray = flag; } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 103 unsigned m_specificity : 24; | 103 unsigned m_specificity : 24; |
| 104 unsigned m_containsUncommonAttributeSelector : 1; | 104 unsigned m_containsUncommonAttributeSelector : 1; |
| 105 unsigned m_linkMatchType : 2; // CSSSelector::LinkMatchMask | 105 unsigned m_linkMatchType : 2; // CSSSelector::LinkMatchMask |
| 106 unsigned m_hasDocumentSecurityOrigin : 1; | 106 unsigned m_hasDocumentSecurityOrigin : 1; |
| 107 unsigned m_propertyWhitelistType : 2; | 107 unsigned m_propertyWhitelistType : 2; |
| 108 // Use plain array instead of a Vector to minimize memory overhead. | 108 // Use plain array instead of a Vector to minimize memory overhead. |
| 109 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; | 109 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 struct SameSizeAsRuleData { | 112 struct SameSizeAsRuleData { |
| 113 DISALLOW_ALLOCATION(); | 113 DISALLOW_NEW(); |
| 114 void* a; | 114 void* a; |
| 115 unsigned b; | 115 unsigned b; |
| 116 unsigned c; | 116 unsigned c; |
| 117 unsigned d[4]; | 117 unsigned d[4]; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should s
tay small"); | 120 static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should s
tay small"); |
| 121 | 121 |
| 122 class CORE_EXPORT RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet
> { | 122 class CORE_EXPORT RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet
> { |
| 123 WTF_MAKE_NONCOPYABLE(RuleSet); | 123 WTF_MAKE_NONCOPYABLE(RuleSet); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 WillBeHeapVector<RuleData> m_allRules; | 232 WillBeHeapVector<RuleData> m_allRules; |
| 233 #endif | 233 #endif |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 } // namespace blink | 236 } // namespace blink |
| 237 | 237 |
| 238 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); | 238 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); |
| 239 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData); | 239 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData); |
| 240 | 240 |
| 241 #endif // RuleSet_h | 241 #endif // RuleSet_h |
| OLD | NEW |