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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool isPaintValue() const { return m_classType == PaintClass; } | 68 bool isPaintValue() const { return m_classType == PaintClass; } |
69 bool isFontFeatureValue() const { return m_classType == FontFeatureClass; } | 69 bool isFontFeatureValue() const { return m_classType == FontFeatureClass; } |
70 bool isFontFamilyValue() const { return m_classType == FontFamilyClass; } | 70 bool isFontFamilyValue() const { return m_classType == FontFamilyClass; } |
71 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; } | 71 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; } |
72 bool isFunctionValue() const { return m_classType == FunctionClass; } | 72 bool isFunctionValue() const { return m_classType == FunctionClass; } |
73 bool isCustomIdentValue() const { return m_classType == CustomIdentClass; } | 73 bool isCustomIdentValue() const { return m_classType == CustomIdentClass; } |
74 bool isImageGeneratorValue() const { return m_classType >= CrossfadeClass &&
m_classType <= RadialGradientClass; } | 74 bool isImageGeneratorValue() const { return m_classType >= CrossfadeClass &&
m_classType <= RadialGradientClass; } |
75 bool isGradientValue() const { return m_classType >= LinearGradientClass &&
m_classType <= RadialGradientClass; } | 75 bool isGradientValue() const { return m_classType >= LinearGradientClass &&
m_classType <= RadialGradientClass; } |
76 bool isImageSetValue() const { return m_classType == ImageSetClass; } | 76 bool isImageSetValue() const { return m_classType == ImageSetClass; } |
77 bool isImageValue() const { return m_classType == ImageClass; } | 77 bool isImageValue() const { return m_classType == ImageClass; } |
78 bool isImplicitInitialValue() const; | 78 bool isImplicit() const { return m_implicit; } |
79 bool isInheritedValue() const { return m_classType == InheritedClass; } | 79 bool isInheritedValue() const { return m_classType == InheritedClass; } |
80 bool isInitialValue() const { return m_classType == InitialClass; } | 80 bool isInitialValue() const { return m_classType == InitialClass || m_implic
it; } |
81 bool isUnsetValue() const { return m_classType == UnsetClass; } | 81 bool isUnsetValue() const { return m_classType == UnsetClass; } |
82 bool isCSSWideKeyword() const { return m_classType >= InheritedClass && m_cl
assType <= UnsetClass; } | 82 bool isCSSWideKeyword() const { return m_classType >= InheritedClass && m_cl
assType <= UnsetClass; } |
83 bool isLinearGradientValue() const { return m_classType == LinearGradientCla
ss; } | 83 bool isLinearGradientValue() const { return m_classType == LinearGradientCla
ss; } |
84 bool isPathValue() const { return m_classType == PathClass; } | 84 bool isPathValue() const { return m_classType == PathClass; } |
85 bool isQuadValue() const { return m_classType == QuadClass; } | 85 bool isQuadValue() const { return m_classType == QuadClass; } |
86 bool isRadialGradientValue() const { return m_classType == RadialGradientCla
ss; } | 86 bool isRadialGradientValue() const { return m_classType == RadialGradientCla
ss; } |
87 bool isReflectValue() const { return m_classType == ReflectClass; } | 87 bool isReflectValue() const { return m_classType == ReflectClass; } |
88 bool isShadowValue() const { return m_classType == ShadowClass; } | 88 bool isShadowValue() const { return m_classType == ShadowClass; } |
89 bool isStringValue() const { return m_classType == StringClass; } | 89 bool isStringValue() const { return m_classType == StringClass; } |
90 bool isURIValue() const { return m_classType == URIClass; } | 90 bool isURIValue() const { return m_classType == URIClass; } |
91 bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicB
ezierTimingFunctionClass; } | 91 bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicB
ezierTimingFunctionClass; } |
92 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingF
unctionClass; } | 92 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingF
unctionClass; } |
93 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAr
easClass; } | 93 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAr
easClass; } |
94 bool isContentDistributionValue() const { return m_classType == CSSContentDi
stributionClass; } | 94 bool isContentDistributionValue() const { return m_classType == CSSContentDi
stributionClass; } |
95 bool isUnicodeRangeValue() const { return m_classType == UnicodeRangeClass;
} | 95 bool isUnicodeRangeValue() const { return m_classType == UnicodeRangeClass;
} |
96 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass
; } | 96 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass
; } |
97 bool isCustomPropertyDeclaration() const { return m_classType == CustomPrope
rtyDeclarationClass; } | 97 bool isCustomPropertyDeclaration() const { return m_classType == CustomPrope
rtyDeclarationClass; } |
98 bool isVariableReferenceValue() const { return m_classType == VariableRefere
nceClass; } | 98 bool isVariableReferenceValue() const { return m_classType == VariableRefere
nceClass; } |
99 bool isGridAutoRepeatValue() const { return m_classType == GridAutoRepeatCla
ss; } | 99 bool isGridAutoRepeatValue() const { return m_classType == GridAutoRepeatCla
ss; } |
100 bool isPendingSubstitutionValue() const { return m_classType == PendingSubst
itutionValueClass; } | 100 bool isPendingSubstitutionValue() const { return m_classType == PendingSubst
itutionValueClass; } |
101 | 101 |
102 bool hasFailedOrCanceledSubresources() const; | 102 bool hasFailedOrCanceledSubresources() const; |
103 | 103 |
| 104 void setImplicit() { m_implicit = true; } |
| 105 |
104 bool equals(const CSSValue&) const; | 106 bool equals(const CSSValue&) const; |
105 | 107 |
106 void finalizeGarbageCollectedObject(); | 108 void finalizeGarbageCollectedObject(); |
107 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } | 109 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } |
108 DECLARE_TRACE(); | 110 DECLARE_TRACE(); |
109 | 111 |
110 // ~CSSValue should be public, because non-public ~CSSValue causes C2248 | 112 // ~CSSValue should be public, because non-public ~CSSValue causes C2248 |
111 // error: 'blink::CSSValue::~CSSValue' : cannot access protected member | 113 // error: 'blink::CSSValue::~CSSValue' : cannot access protected member |
112 // declared in class 'blink::CSSValue' when compiling | 114 // declared in class 'blink::CSSValue' when compiling |
113 // 'source\wtf\refcounted.h' by using msvc. | 115 // 'source\wtf\refcounted.h' by using msvc. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 SpaceSeparator, | 183 SpaceSeparator, |
182 CommaSeparator, | 184 CommaSeparator, |
183 SlashSeparator | 185 SlashSeparator |
184 }; | 186 }; |
185 | 187 |
186 ClassType getClassType() const { return static_cast<ClassType>(m_classType);
} | 188 ClassType getClassType() const { return static_cast<ClassType>(m_classType);
} |
187 | 189 |
188 explicit CSSValue(ClassType classType) | 190 explicit CSSValue(ClassType classType) |
189 : m_primitiveUnitType(0) | 191 : m_primitiveUnitType(0) |
190 , m_hasCachedCSSText(false) | 192 , m_hasCachedCSSText(false) |
| 193 , m_implicit(false) |
191 , m_valueListSeparator(SpaceSeparator) | 194 , m_valueListSeparator(SpaceSeparator) |
192 , m_classType(classType) | 195 , m_classType(classType) |
193 { | 196 { |
194 } | 197 } |
195 | 198 |
196 // NOTE: This class is non-virtual for memory and performance reasons. | 199 // NOTE: This class is non-virtual for memory and performance reasons. |
197 // Don't go making it virtual again unless you know exactly what you're doin
g! | 200 // Don't go making it virtual again unless you know exactly what you're doin
g! |
198 | 201 |
199 protected: | 202 protected: |
200 // The bits in this section are only used by specific subclasses but kept he
re | 203 // The bits in this section are only used by specific subclasses but kept he
re |
201 // to maximize struct packing. | 204 // to maximize struct packing. |
202 | 205 |
203 // CSSPrimitiveValue bits: | 206 // CSSPrimitiveValue bits: |
204 unsigned m_primitiveUnitType : 7; // CSSPrimitiveValue::UnitType | 207 unsigned m_primitiveUnitType : 7; // CSSPrimitiveValue::UnitType |
205 mutable unsigned m_hasCachedCSSText : 1; | 208 mutable unsigned m_hasCachedCSSText : 1; |
| 209 mutable unsigned m_implicit : 1; |
206 | 210 |
207 unsigned m_valueListSeparator : ValueListSeparatorBits; | 211 unsigned m_valueListSeparator : ValueListSeparatorBits; |
208 | 212 |
209 private: | 213 private: |
210 unsigned m_classType : ClassTypeBits; // ClassType | 214 unsigned m_classType : ClassTypeBits; // ClassType |
211 }; | 215 }; |
212 | 216 |
213 template<typename CSSValueType, size_t inlineCapacity> | 217 template<typename CSSValueType, size_t inlineCapacity> |
214 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC
apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s
econdVector) | 218 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC
apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s
econdVector) |
215 { | 219 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 return false; | 260 return false; |
257 return first->equals(*second); | 261 return first->equals(*second); |
258 } | 262 } |
259 | 263 |
260 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ | 264 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ |
261 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) | 265 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) |
262 | 266 |
263 } // namespace blink | 267 } // namespace blink |
264 | 268 |
265 #endif // CSSValue_h | 269 #endif // CSSValue_h |
OLD | NEW |