| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 RuleData(StyleRule*, unsigned selectorIndex, unsigned position, AddRuleFlags
); | 49 RuleData(StyleRule*, unsigned selectorIndex, unsigned position, AddRuleFlags
); |
| 50 | 50 |
| 51 unsigned position() const { return m_position; } | 51 unsigned position() const { return m_position; } |
| 52 StyleRule* rule() const { return m_rule; } | 52 StyleRule* rule() const { return m_rule; } |
| 53 const CSSSelector& selector() const { return m_rule->selectorList().selector
At(m_selectorIndex); } | 53 const CSSSelector& selector() const { return m_rule->selectorList().selector
At(m_selectorIndex); } |
| 54 unsigned selectorIndex() const { return m_selectorIndex; } | 54 unsigned selectorIndex() const { return m_selectorIndex; } |
| 55 | 55 |
| 56 bool isLastInArray() const { return m_isLastInArray; } | 56 bool isLastInArray() const { return m_isLastInArray; } |
| 57 void setLastInArray(bool flag) { m_isLastInArray = flag; } | 57 void setLastInArray(bool flag) { m_isLastInArray = flag; } |
| 58 | 58 |
| 59 bool containsAttributeSelector() const { return m_containsAttributeSelector;
} | |
| 60 | |
| 61 private: | 59 private: |
| 62 RawPtr<StyleRule> m_rule; | 60 RawPtr<StyleRule> m_rule; |
| 63 unsigned m_selectorIndex : 12; | 61 unsigned m_selectorIndex : 12; |
| 64 unsigned m_isLastInArray : 1; // We store an array of RuleData objects in a
primitive array. | 62 unsigned m_isLastInArray : 1; // We store an array of RuleData objects in a
primitive array. |
| 65 // This number was picked fairly arbitrarily. We can probably lower it if we
need to. | 63 // This number was picked fairly arbitrarily. We can probably lower it if we
need to. |
| 66 // Some simple testing showed <100,000 RuleData's on large sites. | 64 // Some simple testing showed <100,000 RuleData's on large sites. |
| 67 unsigned m_position : 17; | 65 unsigned m_position : 17; |
| 68 unsigned m_containsAttributeSelector : 1; | |
| 69 }; | 66 }; |
| 70 | 67 |
| 71 struct SameSizeAsRuleData { | 68 struct SameSizeAsRuleData { |
| 72 void* a; | 69 void* a; |
| 73 unsigned b; | 70 unsigned b; |
| 74 }; | 71 }; |
| 75 | 72 |
| 76 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_s
tay_small); | 73 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_s
tay_small); |
| 77 | 74 |
| 78 class RuleSet { | 75 class RuleSet { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 #ifndef NDEBUG | 162 #ifndef NDEBUG |
| 166 Vector<RuleData> m_allRules; | 163 Vector<RuleData> m_allRules; |
| 167 #endif | 164 #endif |
| 168 }; | 165 }; |
| 169 | 166 |
| 170 } // namespace blink | 167 } // namespace blink |
| 171 | 168 |
| 172 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); | 169 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); |
| 173 | 170 |
| 174 #endif // SKY_ENGINE_CORE_CSS_RULESET_H_ | 171 #endif // SKY_ENGINE_CORE_CSS_RULESET_H_ |
| OLD | NEW |