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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ASSERT(m_ruleData); | 54 ASSERT(m_ruleData); |
55 static const unsigned BitsForPositionInRuleData = 18; | 55 static const unsigned BitsForPositionInRuleData = 18; |
56 static const unsigned BitsForStyleSheetIndex = 32; | 56 static const unsigned BitsForStyleSheetIndex = 32; |
57 m_position = ((uint64_t)cascadeOrder << (BitsForStyleSheetIndex + BitsFo
rPositionInRuleData)) + ((uint64_t)styleSheetIndex << BitsForPositionInRuleData)
+ m_ruleData->position(); | 57 m_position = ((uint64_t)cascadeOrder << (BitsForStyleSheetIndex + BitsFo
rPositionInRuleData)) + ((uint64_t)styleSheetIndex << BitsForPositionInRuleData)
+ m_ruleData->position(); |
58 } | 58 } |
59 | 59 |
60 const RuleData* ruleData() const { return m_ruleData; } | 60 const RuleData* ruleData() const { return m_ruleData; } |
61 uint64_t position() const { return m_position; } | 61 uint64_t position() const { return m_position; } |
62 unsigned specificity() const { return ruleData()->specificity() + m_specific
ity; } | 62 unsigned specificity() const { return ruleData()->specificity() + m_specific
ity; } |
63 const CSSStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; } | 63 const CSSStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; } |
64 void trace(Visitor* visitor) | 64 DEFINE_INLINE_TRACE() |
65 { | 65 { |
66 visitor->trace(m_parentStyleSheet); | 66 visitor->trace(m_parentStyleSheet); |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 // FIXME: Oilpan: RuleData is in the oilpan heap and this pointer | 70 // FIXME: Oilpan: RuleData is in the oilpan heap and this pointer |
71 // really should be traced. However, RuleData objects are | 71 // really should be traced. However, RuleData objects are |
72 // allocated inside larger TerminatedArray objects and we cannot | 72 // allocated inside larger TerminatedArray objects and we cannot |
73 // trace a raw rule data pointer at this point. | 73 // trace a raw rule data pointer at this point. |
74 const RuleData* m_ruleData; | 74 const RuleData* m_ruleData; |
75 unsigned m_specificity; | 75 unsigned m_specificity; |
76 uint64_t m_position; | 76 uint64_t m_position; |
77 RawPtrWillBeMember<const CSSStyleSheet> m_parentStyleSheet; | 77 RawPtrWillBeMember<const CSSStyleSheet> m_parentStyleSheet; |
78 }; | 78 }; |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
81 | 81 |
82 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule); | 82 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule); |
83 | 83 |
84 namespace blink { | 84 namespace blink { |
85 | 85 |
86 // FIXME: oilpan: when transition types are gone this class can be replaced with
HeapVector. | 86 // FIXME: oilpan: when transition types are gone this class can be replaced with
HeapVector. |
87 class StyleRuleList final : public RefCountedWillBeGarbageCollected<StyleRuleLis
t> { | 87 class StyleRuleList final : public RefCountedWillBeGarbageCollected<StyleRuleLis
t> { |
88 public: | 88 public: |
89 static PassRefPtrWillBeRawPtr<StyleRuleList> create() { return adoptRefWillB
eNoop(new StyleRuleList()); } | 89 static PassRefPtrWillBeRawPtr<StyleRuleList> create() { return adoptRefWillB
eNoop(new StyleRuleList()); } |
90 | 90 |
91 void trace(Visitor* visitor) | 91 DEFINE_INLINE_TRACE() |
92 { | 92 { |
93 #if ENABLE(OILPAN) | 93 #if ENABLE(OILPAN) |
94 visitor->trace(m_list); | 94 visitor->trace(m_list); |
95 #endif | 95 #endif |
96 } | 96 } |
97 | 97 |
98 WillBeHeapVector<RawPtrWillBeMember<StyleRule> > m_list; | 98 WillBeHeapVector<RawPtrWillBeMember<StyleRule> > m_list; |
99 }; | 99 }; |
100 | 100 |
101 // ElementRuleCollector is designed to be used as a stack object. | 101 // ElementRuleCollector is designed to be used as a stack object. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 // Output. | 171 // Output. |
172 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; | 172 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; |
173 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; | 173 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; |
174 MatchResult m_result; | 174 MatchResult m_result; |
175 }; | 175 }; |
176 | 176 |
177 } // namespace blink | 177 } // namespace blink |
178 | 178 |
179 #endif // ElementRuleCollector_h | 179 #endif // ElementRuleCollector_h |
OLD | NEW |