OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 static const size_t ValueListSeparatorBits = 2; | 176 static const size_t ValueListSeparatorBits = 2; |
177 enum ValueListSeparator { | 177 enum ValueListSeparator { |
178 SpaceSeparator, | 178 SpaceSeparator, |
179 CommaSeparator, | 179 CommaSeparator, |
180 SlashSeparator | 180 SlashSeparator |
181 }; | 181 }; |
182 | 182 |
183 ClassType getClassType() const { return static_cast<ClassType>(m_classType);
} | 183 ClassType getClassType() const { return static_cast<ClassType>(m_classType);
} |
184 | 184 |
185 explicit CSSValue(ClassType classType) | 185 explicit CSSValue(ClassType classType) |
186 : m_primitiveUnitType(0) | 186 : m_classType(classType) |
187 , m_hasCachedCSSText(false) | |
188 , m_valueListSeparator(SpaceSeparator) | |
189 , m_classType(classType) | |
190 { | 187 { |
191 } | 188 } |
192 | 189 |
193 // NOTE: This class is non-virtual for memory and performance reasons. | 190 // NOTE: This class is non-virtual for memory and performance reasons. |
194 // Don't go making it virtual again unless you know exactly what you're doin
g! | 191 // Don't go making it virtual again unless you know exactly what you're doin
g! |
195 | 192 |
196 protected: | |
197 // The bits in this section are only used by specific subclasses but kept he
re | |
198 // to maximize struct packing. | |
199 | |
200 // CSSPrimitiveValue bits: | |
201 unsigned m_primitiveUnitType : 7; // CSSPrimitiveValue::UnitType | |
202 mutable unsigned m_hasCachedCSSText : 1; | |
203 | |
204 unsigned m_valueListSeparator : ValueListSeparatorBits; | |
205 | |
206 private: | |
207 unsigned m_classType : ClassTypeBits; // ClassType | 193 unsigned m_classType : ClassTypeBits; // ClassType |
208 }; | 194 }; |
209 | 195 |
210 template<typename CSSValueType, size_t inlineCapacity> | 196 template<typename CSSValueType, size_t inlineCapacity> |
211 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC
apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s
econdVector) | 197 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC
apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s
econdVector) |
212 { | 198 { |
213 size_t size = firstVector.size(); | 199 size_t size = firstVector.size(); |
214 if (size != secondVector.size()) | 200 if (size != secondVector.size()) |
215 return false; | 201 return false; |
216 | 202 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 return false; | 239 return false; |
254 return first->equals(*second); | 240 return first->equals(*second); |
255 } | 241 } |
256 | 242 |
257 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ | 243 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ |
258 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) | 244 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) |
259 | 245 |
260 } // namespace blink | 246 } // namespace blink |
261 | 247 |
262 #endif // CSSValue_h | 248 #endif // CSSValue_h |
OLD | NEW |