Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: Source/core/css/CSSValue.h

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Fixing tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 bool isBaseValueList() const { return m_classType == ValueListClass; } 65 bool isBaseValueList() const { return m_classType == ValueListClass; }
66 66
67 bool isBorderImageSliceValue() const { return m_classType == BorderImageSlic eClass; } 67 bool isBorderImageSliceValue() const { return m_classType == BorderImageSlic eClass; }
68 bool isCanvasValue() const { return m_classType == CanvasClass; } 68 bool isCanvasValue() const { return m_classType == CanvasClass; }
69 bool isCounterValue() const { return m_classType == CounterClass; } 69 bool isCounterValue() const { return m_classType == CounterClass; }
70 bool isCursorImageValue() const { return m_classType == CursorImageClass; } 70 bool isCursorImageValue() const { return m_classType == CursorImageClass; }
71 bool isCrossfadeValue() const { return m_classType == CrossfadeClass; } 71 bool isCrossfadeValue() const { return m_classType == CrossfadeClass; }
72 bool isFontFeatureValue() const { return m_classType == FontFeatureClass; } 72 bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
73 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; } 73 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; }
74 bool isFunctionValue() const { return m_classType == FunctionClass; } 74 bool isFunctionValue() const { return m_classType == FunctionClass; }
75 bool isCustomIdentValue() const { return m_classType == CustomIdentClass; }
75 bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_ classType <= RadialGradientClass; } 76 bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_ classType <= RadialGradientClass; }
76 bool isGradientValue() const { return m_classType >= LinearGradientClass && m_classType <= RadialGradientClass; } 77 bool isGradientValue() const { return m_classType >= LinearGradientClass && m_classType <= RadialGradientClass; }
77 bool isImageSetValue() const { return m_classType == ImageSetClass; } 78 bool isImageSetValue() const { return m_classType == ImageSetClass; }
78 bool isImageValue() const { return m_classType == ImageClass; } 79 bool isImageValue() const { return m_classType == ImageClass; }
79 bool isImplicitInitialValue() const; 80 bool isImplicitInitialValue() const;
80 bool isInheritedValue() const { return m_classType == InheritedClass; } 81 bool isInheritedValue() const { return m_classType == InheritedClass; }
81 bool isInitialValue() const { return m_classType == InitialClass; } 82 bool isInitialValue() const { return m_classType == InitialClass; }
82 bool isUnsetValue() const { return m_classType == UnsetClass; } 83 bool isUnsetValue() const { return m_classType == UnsetClass; }
83 bool isCSSWideKeyword() const { return m_classType >= InheritedClass && m_cl assType <= UnsetClass; } 84 bool isCSSWideKeyword() const { return m_classType >= InheritedClass && m_cl assType <= UnsetClass; }
84 bool isLinearGradientValue() const { return m_classType == LinearGradientCla ss; } 85 bool isLinearGradientValue() const { return m_classType == LinearGradientCla ss; }
85 bool isPathValue() const { return m_classType == PathClass; } 86 bool isPathValue() const { return m_classType == PathClass; }
86 bool isQuadValue() const { return m_classType == QuadClass; } 87 bool isQuadValue() const { return m_classType == QuadClass; }
87 bool isRadialGradientValue() const { return m_classType == RadialGradientCla ss; } 88 bool isRadialGradientValue() const { return m_classType == RadialGradientCla ss; }
88 bool isReflectValue() const { return m_classType == ReflectClass; } 89 bool isReflectValue() const { return m_classType == ReflectClass; }
89 bool isShadowValue() const { return m_classType == ShadowClass; } 90 bool isShadowValue() const { return m_classType == ShadowClass; }
91 bool isStringValue() const { return m_classType == StringClass; }
92 bool isURIValue() const { return m_classType == URIClass; }
90 bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicB ezierTimingFunctionClass; } 93 bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicB ezierTimingFunctionClass; }
91 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingF unctionClass; } 94 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingF unctionClass; }
92 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAr easClass; } 95 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAr easClass; }
93 bool isSVGDocumentValue() const { return m_classType == CSSSVGDocumentClass; } 96 bool isSVGDocumentValue() const { return m_classType == CSSSVGDocumentClass; }
94 bool isContentDistributionValue() const { return m_classType == CSSContentDi stributionClass; } 97 bool isContentDistributionValue() const { return m_classType == CSSContentDi stributionClass; }
95 bool isUnicodeRangeValue() const { return m_classType == UnicodeRangeClass; } 98 bool isUnicodeRangeValue() const { return m_classType == UnicodeRangeClass; }
96 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass ; } 99 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass ; }
97 100
98 bool hasFailedOrCanceledSubresources() const; 101 bool hasFailedOrCanceledSubresources() const;
99 102
100 bool equals(const CSSValue&) const; 103 bool equals(const CSSValue&) const;
101 104
102 void finalizeGarbageCollectedObject(); 105 void finalizeGarbageCollectedObject();
103 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } 106 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { }
104 DECLARE_TRACE(); 107 DECLARE_TRACE();
105 108
106 // ~CSSValue should be public, because non-public ~CSSValue causes C2248 109 // ~CSSValue should be public, because non-public ~CSSValue causes C2248
107 // error: 'blink::CSSValue::~CSSValue' : cannot access protected member 110 // error: 'blink::CSSValue::~CSSValue' : cannot access protected member
108 // declared in class 'blink::CSSValue' when compiling 111 // declared in class 'blink::CSSValue' when compiling
109 // 'source\wtf\refcounted.h' by using msvc. 112 // 'source\wtf\refcounted.h' by using msvc.
110 ~CSSValue() { } 113 ~CSSValue() { }
111 114
112 protected:
113
114 static const size_t ClassTypeBits = 6; 115 static const size_t ClassTypeBits = 6;
115 enum ClassType { 116 enum ClassType {
116 PrimitiveClass, 117 PrimitiveClass,
117 CounterClass, 118 CounterClass,
118 QuadClass, 119 QuadClass,
120 CustomIdentClass,
121 StringClass,
122 URIClass,
119 ValuePairClass, 123 ValuePairClass,
120 124
121 // Image classes. 125 // Image classes.
122 ImageClass, 126 ImageClass,
123 CursorImageClass, 127 CursorImageClass,
124 128
125 // Image generator classes. 129 // Image generator classes.
126 CanvasClass, 130 CanvasClass,
127 CrossfadeClass, 131 CrossfadeClass,
128 LinearGradientClass, 132 LinearGradientClass,
(...skipping 24 matching lines...) Expand all
153 CSSContentDistributionClass, 157 CSSContentDistributionClass,
154 158
155 // List class types must appear after ValueListClass. 159 // List class types must appear after ValueListClass.
156 ValueListClass, 160 ValueListClass,
157 FunctionClass, 161 FunctionClass,
158 ImageSetClass, 162 ImageSetClass,
159 GridLineNamesClass, 163 GridLineNamesClass,
160 // Do not append non-list class types here. 164 // Do not append non-list class types here.
161 }; 165 };
162 166
167 protected:
163 static const size_t ValueListSeparatorBits = 2; 168 static const size_t ValueListSeparatorBits = 2;
164 enum ValueListSeparator { 169 enum ValueListSeparator {
165 SpaceSeparator, 170 SpaceSeparator,
166 CommaSeparator, 171 CommaSeparator,
167 SlashSeparator 172 SlashSeparator
168 }; 173 };
169 174
170 ClassType classType() const { return static_cast<ClassType>(m_classType); } 175 ClassType classType() const { return static_cast<ClassType>(m_classType); }
171 176
172 explicit CSSValue(ClassType classType) 177 explicit CSSValue(ClassType classType)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 return false; 248 return false;
244 return first->equals(*second); 249 return first->equals(*second);
245 } 250 }
246 251
247 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ 252 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
248 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te) 253 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te)
249 254
250 } // namespace blink 255 } // namespace blink
251 256
252 #endif // CSSValue_h 257 #endif // CSSValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698