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

Side by Side Diff: third_party/WebKit/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: Rebase Created 5 years, 2 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool isBasicShapeInsetValue() const { return m_classType == BasicShapeInsetC lass; } 71 bool isBasicShapeInsetValue() const { return m_classType == BasicShapeInsetC lass; }
72 72
73 bool isBorderImageSliceValue() const { return m_classType == BorderImageSlic eClass; } 73 bool isBorderImageSliceValue() const { return m_classType == BorderImageSlic eClass; }
74 bool isCanvasValue() const { return m_classType == CanvasClass; } 74 bool isCanvasValue() const { return m_classType == CanvasClass; }
75 bool isCounterValue() const { return m_classType == CounterClass; } 75 bool isCounterValue() const { return m_classType == CounterClass; }
76 bool isCursorImageValue() const { return m_classType == CursorImageClass; } 76 bool isCursorImageValue() const { return m_classType == CursorImageClass; }
77 bool isCrossfadeValue() const { return m_classType == CrossfadeClass; } 77 bool isCrossfadeValue() const { return m_classType == CrossfadeClass; }
78 bool isFontFeatureValue() const { return m_classType == FontFeatureClass; } 78 bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
79 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; } 79 bool isFontFaceSrcValue() const { return m_classType == FontFaceSrcClass; }
80 bool isFunctionValue() const { return m_classType == FunctionClass; } 80 bool isFunctionValue() const { return m_classType == FunctionClass; }
81 bool isCustomIdentValue() const { return m_classType == CustomIdentClass; }
81 bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_ classType <= RadialGradientClass; } 82 bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_ classType <= RadialGradientClass; }
82 bool isGradientValue() const { return m_classType >= LinearGradientClass && m_classType <= RadialGradientClass; } 83 bool isGradientValue() const { return m_classType >= LinearGradientClass && m_classType <= RadialGradientClass; }
83 bool isImageSetValue() const { return m_classType == ImageSetClass; } 84 bool isImageSetValue() const { return m_classType == ImageSetClass; }
84 bool isImageValue() const { return m_classType == ImageClass; } 85 bool isImageValue() const { return m_classType == ImageClass; }
85 bool isImplicitInitialValue() const; 86 bool isImplicitInitialValue() const;
86 bool isInheritedValue() const { return m_classType == InheritedClass; } 87 bool isInheritedValue() const { return m_classType == InheritedClass; }
87 bool isInitialValue() const { return m_classType == InitialClass; } 88 bool isInitialValue() const { return m_classType == InitialClass; }
88 bool isUnsetValue() const { return m_classType == UnsetClass; } 89 bool isUnsetValue() const { return m_classType == UnsetClass; }
89 bool isCSSWideKeyword() const { return m_classType >= InheritedClass && m_cl assType <= UnsetClass; } 90 bool isCSSWideKeyword() const { return m_classType >= InheritedClass && m_cl assType <= UnsetClass; }
90 bool isLinearGradientValue() const { return m_classType == LinearGradientCla ss; } 91 bool isLinearGradientValue() const { return m_classType == LinearGradientCla ss; }
91 bool isPathValue() const { return m_classType == PathClass; } 92 bool isPathValue() const { return m_classType == PathClass; }
92 bool isQuadValue() const { return m_classType == QuadClass; } 93 bool isQuadValue() const { return m_classType == QuadClass; }
93 bool isRadialGradientValue() const { return m_classType == RadialGradientCla ss; } 94 bool isRadialGradientValue() const { return m_classType == RadialGradientCla ss; }
94 bool isReflectValue() const { return m_classType == ReflectClass; } 95 bool isReflectValue() const { return m_classType == ReflectClass; }
95 bool isShadowValue() const { return m_classType == ShadowClass; } 96 bool isShadowValue() const { return m_classType == ShadowClass; }
97 bool isStringValue() const { return m_classType == StringClass; }
98 bool isURIValue() const { return m_classType == URIClass; }
96 bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicB ezierTimingFunctionClass; } 99 bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicB ezierTimingFunctionClass; }
97 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingF unctionClass; } 100 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingF unctionClass; }
98 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAr easClass; } 101 bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAr easClass; }
99 bool isSVGDocumentValue() const { return m_classType == CSSSVGDocumentClass; } 102 bool isSVGDocumentValue() const { return m_classType == CSSSVGDocumentClass; }
100 bool isContentDistributionValue() const { return m_classType == CSSContentDi stributionClass; } 103 bool isContentDistributionValue() const { return m_classType == CSSContentDi stributionClass; }
101 bool isUnicodeRangeValue() const { return m_classType == UnicodeRangeClass; } 104 bool isUnicodeRangeValue() const { return m_classType == UnicodeRangeClass; }
102 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass ; } 105 bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass ; }
103 106
104 bool hasFailedOrCanceledSubresources() const; 107 bool hasFailedOrCanceledSubresources() const;
105 108
106 bool equals(const CSSValue&) const; 109 bool equals(const CSSValue&) const;
107 110
108 void finalizeGarbageCollectedObject(); 111 void finalizeGarbageCollectedObject();
109 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { } 112 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { }
110 DECLARE_TRACE(); 113 DECLARE_TRACE();
111 114
112 // ~CSSValue should be public, because non-public ~CSSValue causes C2248 115 // ~CSSValue should be public, because non-public ~CSSValue causes C2248
113 // error: 'blink::CSSValue::~CSSValue' : cannot access protected member 116 // error: 'blink::CSSValue::~CSSValue' : cannot access protected member
114 // declared in class 'blink::CSSValue' when compiling 117 // declared in class 'blink::CSSValue' when compiling
115 // 'source\wtf\refcounted.h' by using msvc. 118 // 'source\wtf\refcounted.h' by using msvc.
116 ~CSSValue() { } 119 ~CSSValue() { }
117 120
118 protected: 121 protected:
119
120 static const size_t ClassTypeBits = 6; 122 static const size_t ClassTypeBits = 6;
121 enum ClassType { 123 enum ClassType {
122 PrimitiveClass, 124 PrimitiveClass,
123 CounterClass, 125 CounterClass,
124 QuadClass, 126 QuadClass,
127 CustomIdentClass,
128 StringClass,
129 URIClass,
125 ValuePairClass, 130 ValuePairClass,
126 131
127 // Basic shape classes. 132 // Basic shape classes.
128 // TODO(sashab): Represent these as a single subclass, BasicShapeClass. 133 // TODO(sashab): Represent these as a single subclass, BasicShapeClass.
129 BasicShapeCircleClass, 134 BasicShapeCircleClass,
130 BasicShapeEllipseClass, 135 BasicShapeEllipseClass,
131 BasicShapePolygonClass, 136 BasicShapePolygonClass,
132 BasicShapeInsetClass, 137 BasicShapeInsetClass,
133 138
134 // Image classes. 139 // Image classes.
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return false; 261 return false;
257 return first->equals(*second); 262 return first->equals(*second);
258 } 263 }
259 264
260 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ 265 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
261 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te) 266 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te)
262 267
263 } // namespace blink 268 } // namespace blink
264 269
265 #endif // CSSValue_h 270 #endif // CSSValue_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSURIValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698