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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 unsigned m_position : 18; | 102 unsigned m_position : 18; |
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 { | |
113 DISALLOW_ALLOCATION(); | |
114 void* a; | |
115 unsigned b; | |
116 unsigned c; | |
117 unsigned d[4]; | |
118 }; | |
119 | |
120 static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should s
tay small"); | |
121 | |
122 class CORE_EXPORT RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet
> { | 112 class CORE_EXPORT RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet
> { |
123 WTF_MAKE_NONCOPYABLE(RuleSet); | 113 WTF_MAKE_NONCOPYABLE(RuleSet); |
124 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(RuleSet); | 114 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(RuleSet); |
125 public: | 115 public: |
126 static PassOwnPtrWillBeRawPtr<RuleSet> create() { return adoptPtrWillBeNoop(
new RuleSet); } | 116 static PassOwnPtrWillBeRawPtr<RuleSet> create() { return adoptPtrWillBeNoop(
new RuleSet); } |
127 | 117 |
128 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR
uleFlags = RuleHasNoSpecialState); | 118 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR
uleFlags = RuleHasNoSpecialState); |
129 void addStyleRule(StyleRule*, AddRuleFlags); | 119 void addStyleRule(StyleRule*, AddRuleFlags); |
130 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags); | 120 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags); |
131 | 121 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 WillBeHeapVector<RuleData> m_allRules; | 222 WillBeHeapVector<RuleData> m_allRules; |
233 #endif | 223 #endif |
234 }; | 224 }; |
235 | 225 |
236 } // namespace blink | 226 } // namespace blink |
237 | 227 |
238 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); | 228 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); |
239 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData); | 229 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData); |
240 | 230 |
241 #endif // RuleSet_h | 231 #endif // RuleSet_h |
OLD | NEW |