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

Side by Side Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 16415007: Cleanup usage of CSSPropertyID and CSSValueID inside Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 case CSSPrimitiveValue::CSS_VW: 86 case CSSPrimitiveValue::CSS_VW:
87 case CSSPrimitiveValue::CSS_VH: 87 case CSSPrimitiveValue::CSS_VH:
88 case CSSPrimitiveValue::CSS_VMIN: 88 case CSSPrimitiveValue::CSS_VMIN:
89 case CSSPrimitiveValue::CSS_VMAX: 89 case CSSPrimitiveValue::CSS_VMAX:
90 case CSSPrimitiveValue::CSS_FR: 90 case CSSPrimitiveValue::CSS_FR:
91 return true; 91 return true;
92 case CSSPrimitiveValue::CSS_ATTR: 92 case CSSPrimitiveValue::CSS_ATTR:
93 case CSSPrimitiveValue::CSS_COUNTER: 93 case CSSPrimitiveValue::CSS_COUNTER:
94 case CSSPrimitiveValue::CSS_COUNTER_NAME: 94 case CSSPrimitiveValue::CSS_COUNTER_NAME:
95 case CSSPrimitiveValue::CSS_IDENT: 95 case CSSPrimitiveValue::CSS_IDENT:
96 case CSSPrimitiveValue::CSS_PROPERTY_ID:
97 case CSSPrimitiveValue::CSS_VALUE_ID:
96 case CSSPrimitiveValue::CSS_PAIR: 98 case CSSPrimitiveValue::CSS_PAIR:
97 case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR: 99 case CSSPrimitiveValue::CSS_PARSER_HEXCOLOR:
98 case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER: 100 case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
99 case CSSPrimitiveValue::CSS_PARSER_INTEGER: 101 case CSSPrimitiveValue::CSS_PARSER_INTEGER:
100 case CSSPrimitiveValue::CSS_PARSER_OPERATOR: 102 case CSSPrimitiveValue::CSS_PARSER_OPERATOR:
101 case CSSPrimitiveValue::CSS_RECT: 103 case CSSPrimitiveValue::CSS_RECT:
102 case CSSPrimitiveValue::CSS_QUAD: 104 case CSSPrimitiveValue::CSS_QUAD:
103 case CSSPrimitiveValue::CSS_RGBCOLOR: 105 case CSSPrimitiveValue::CSS_RGBCOLOR:
104 case CSSPrimitiveValue::CSS_SHAPE: 106 case CSSPrimitiveValue::CSS_SHAPE:
105 case CSSPrimitiveValue::CSS_STRING: 107 case CSSPrimitiveValue::CSS_STRING:
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 159
158 typedef HashMap<const CSSPrimitiveValue*, String> CSSTextCache; 160 typedef HashMap<const CSSPrimitiveValue*, String> CSSTextCache;
159 static CSSTextCache& cssTextCache() 161 static CSSTextCache& cssTextCache()
160 { 162 {
161 DEFINE_STATIC_LOCAL(CSSTextCache, cache, ()); 163 DEFINE_STATIC_LOCAL(CSSTextCache, cache, ());
162 return cache; 164 return cache;
163 } 165 }
164 166
165 unsigned short CSSPrimitiveValue::primitiveType() const 167 unsigned short CSSPrimitiveValue::primitiveType() const
166 { 168 {
169 if (m_primitiveUnitType == CSS_PROPERTY_ID || m_primitiveUnitType == CSS_VAL UE_ID)
170 return CSS_IDENT;
171
167 if (m_primitiveUnitType != CSSPrimitiveValue::CSS_CALC) 172 if (m_primitiveUnitType != CSSPrimitiveValue::CSS_CALC)
168 return m_primitiveUnitType; 173 return m_primitiveUnitType;
169 174
170 switch (m_value.calc->category()) { 175 switch (m_value.calc->category()) {
171 case CalcNumber: 176 case CalcNumber:
172 return CSSPrimitiveValue::CSS_NUMBER; 177 return CSSPrimitiveValue::CSS_NUMBER;
173 case CalcPercent: 178 case CalcPercent:
174 return CSSPrimitiveValue::CSS_PERCENTAGE; 179 return CSSPrimitiveValue::CSS_PERCENTAGE;
175 case CalcLength: 180 case CalcLength:
176 return CSSPrimitiveValue::CSS_PX; 181 return CSSPrimitiveValue::CSS_PX;
177 case CalcPercentNumber: 182 case CalcPercentNumber:
178 return CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER; 183 return CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_NUMBER;
179 case CalcPercentLength: 184 case CalcPercentLength:
180 return CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH; 185 return CSSPrimitiveValue::CSS_CALC_PERCENTAGE_WITH_LENGTH;
181 case CalcVariable: 186 case CalcVariable:
182 return CSSPrimitiveValue::CSS_UNKNOWN; // The type of a calculation cont aining a variable cannot be known until the value of the variable is determined. 187 return CSSPrimitiveValue::CSS_UNKNOWN; // The type of a calculation cont aining a variable cannot be known until the value of the variable is determined.
183 case CalcOther: 188 case CalcOther:
184 return CSSPrimitiveValue::CSS_UNKNOWN; 189 return CSSPrimitiveValue::CSS_UNKNOWN;
185 } 190 }
186 return CSSPrimitiveValue::CSS_UNKNOWN; 191 return CSSPrimitiveValue::CSS_UNKNOWN;
187 } 192 }
188 193
189 static const AtomicString& valueOrPropertyName(int valueOrPropertyID) 194 static const AtomicString& propertyName(CSSPropertyID propertyID)
190 { 195 {
191 ASSERT_ARG(valueOrPropertyID, valueOrPropertyID >= 0); 196 ASSERT_ARG(propertyID, propertyID >= 0);
192 ASSERT_ARG(valueOrPropertyID, valueOrPropertyID < numCSSValueKeywords || (va lueOrPropertyID >= firstCSSProperty && valueOrPropertyID < firstCSSProperty + nu mCSSProperties)); 197 ASSERT_ARG(propertyID, (propertyID >= firstCSSProperty && propertyID < first CSSProperty + numCSSProperties));
193 198
194 if (valueOrPropertyID < 0) 199 if (propertyID < 0)
195 return nullAtom; 200 return nullAtom;
196 201
197 if (valueOrPropertyID < numCSSValueKeywords) { 202 return getPropertyNameAtomicString(propertyID);
198 static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywor ds]; // Leaked intentionally.
199 AtomicString& keywordString = keywordStrings[valueOrPropertyID];
200 if (keywordString.isNull())
201 keywordString = getValueName(valueOrPropertyID);
202 return keywordString;
203 }
204
205 return getPropertyNameAtomicString(static_cast<CSSPropertyID>(valueOrPropert yID));
206 } 203 }
207 204
208 CSSPrimitiveValue::CSSPrimitiveValue(int ident) 205 static const AtomicString& valueName(CSSValueID valueID)
206 {
207 ASSERT_ARG(valueID, valueID >= 0);
208 ASSERT_ARG(valueID, valueID < numCSSValueKeywords);
209
210 if (valueID < 0)
211 return nullAtom;
212
213 static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords]; // Leaked intentionally.
214 AtomicString& keywordString = keywordStrings[valueID];
215 if (keywordString.isNull())
216 keywordString = getValueName(valueID);
217 return keywordString;
218 }
219
220 CSSPrimitiveValue::CSSPrimitiveValue(CSSValueID valueID)
209 : CSSValue(PrimitiveClass) 221 : CSSValue(PrimitiveClass)
210 { 222 {
211 m_primitiveUnitType = CSS_IDENT; 223 m_primitiveUnitType = CSS_VALUE_ID;
212 m_value.ident = ident; 224 m_value.valueID = valueID;
225 }
226
227 CSSPrimitiveValue::CSSPrimitiveValue(CSSPropertyID propertyID)
228 : CSSValue(PrimitiveClass)
229 {
230 m_primitiveUnitType = CSS_PROPERTY_ID;
231 m_value.propertyID = propertyID;
232 }
233
234 CSSPrimitiveValue::CSSPrimitiveValue(int parserOperator)
235 : CSSValue(PrimitiveClass)
236 {
237 m_primitiveUnitType = CSS_PARSER_OPERATOR;
238 m_value.parserOperator = parserOperator;
213 } 239 }
214 240
215 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitTypes type) 241 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitTypes type)
216 : CSSValue(PrimitiveClass) 242 : CSSValue(PrimitiveClass)
217 { 243 {
218 m_primitiveUnitType = type; 244 m_primitiveUnitType = type;
219 ASSERT(std::isfinite(num)); 245 ASSERT(std::isfinite(num));
220 m_value.num = num; 246 m_value.num = num;
221 } 247 }
222 248
(...skipping 11 matching lines...) Expand all
234 { 260 {
235 m_primitiveUnitType = CSS_RGBCOLOR; 261 m_primitiveUnitType = CSS_RGBCOLOR;
236 m_value.rgbcolor = color; 262 m_value.rgbcolor = color;
237 } 263 }
238 264
239 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length) 265 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length)
240 : CSSValue(PrimitiveClass) 266 : CSSValue(PrimitiveClass)
241 { 267 {
242 switch (length.type()) { 268 switch (length.type()) {
243 case Auto: 269 case Auto:
244 m_primitiveUnitType = CSS_IDENT; 270 m_primitiveUnitType = CSS_VALUE_ID;
245 m_value.ident = CSSValueAuto; 271 m_value.valueID = CSSValueAuto;
246 break; 272 break;
247 case WebCore::Fixed: 273 case WebCore::Fixed:
248 m_primitiveUnitType = CSS_PX; 274 m_primitiveUnitType = CSS_PX;
249 m_value.num = length.value(); 275 m_value.num = length.value();
250 break; 276 break;
251 case Intrinsic: 277 case Intrinsic:
252 m_primitiveUnitType = CSS_IDENT; 278 m_primitiveUnitType = CSS_VALUE_ID;
253 m_value.ident = CSSValueIntrinsic; 279 m_value.valueID = CSSValueIntrinsic;
254 break; 280 break;
255 case MinIntrinsic: 281 case MinIntrinsic:
256 m_primitiveUnitType = CSS_IDENT; 282 m_primitiveUnitType = CSS_VALUE_ID;
257 m_value.ident = CSSValueMinIntrinsic; 283 m_value.valueID = CSSValueMinIntrinsic;
258 break; 284 break;
259 case MinContent: 285 case MinContent:
260 m_primitiveUnitType = CSS_IDENT; 286 m_primitiveUnitType = CSS_VALUE_ID;
261 m_value.ident = CSSValueWebkitMinContent; 287 m_value.valueID = CSSValueWebkitMinContent;
262 break; 288 break;
263 case MaxContent: 289 case MaxContent:
264 m_primitiveUnitType = CSS_IDENT; 290 m_primitiveUnitType = CSS_VALUE_ID;
265 m_value.ident = CSSValueWebkitMaxContent; 291 m_value.valueID = CSSValueWebkitMaxContent;
266 break; 292 break;
267 case FillAvailable: 293 case FillAvailable:
268 m_primitiveUnitType = CSS_IDENT; 294 m_primitiveUnitType = CSS_VALUE_ID;
269 m_value.ident = CSSValueWebkitFillAvailable; 295 m_value.valueID = CSSValueWebkitFillAvailable;
270 break; 296 break;
271 case FitContent: 297 case FitContent:
272 m_primitiveUnitType = CSS_IDENT; 298 m_primitiveUnitType = CSS_VALUE_ID;
273 m_value.ident = CSSValueWebkitFitContent; 299 m_value.valueID = CSSValueWebkitFitContent;
274 break; 300 break;
275 case Percent: 301 case Percent:
276 m_primitiveUnitType = CSS_PERCENTAGE; 302 m_primitiveUnitType = CSS_PERCENTAGE;
277 ASSERT(std::isfinite(length.percent())); 303 ASSERT(std::isfinite(length.percent()));
278 m_value.num = length.percent(); 304 m_value.num = length.percent();
279 break; 305 break;
280 case ViewportPercentageWidth: 306 case ViewportPercentageWidth:
281 m_primitiveUnitType = CSS_VW; 307 m_primitiveUnitType = CSS_VW;
282 m_value.num = length.viewportPercentageLength(); 308 m_value.num = length.viewportPercentageLength();
283 break; 309 break;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 case CSS_DPI: 437 case CSS_DPI:
412 case CSS_DPCM: 438 case CSS_DPCM:
413 case CSS_FR: 439 case CSS_FR:
414 case CSS_IDENT: 440 case CSS_IDENT:
415 case CSS_RGBCOLOR: 441 case CSS_RGBCOLOR:
416 case CSS_DIMENSION: 442 case CSS_DIMENSION:
417 case CSS_UNKNOWN: 443 case CSS_UNKNOWN:
418 case CSS_UNICODE_RANGE: 444 case CSS_UNICODE_RANGE:
419 case CSS_PARSER_OPERATOR: 445 case CSS_PARSER_OPERATOR:
420 case CSS_PARSER_IDENTIFIER: 446 case CSS_PARSER_IDENTIFIER:
447 case CSS_PROPERTY_ID:
448 case CSS_VALUE_ID:
421 break; 449 break;
422 } 450 }
423 m_primitiveUnitType = 0; 451 m_primitiveUnitType = 0;
424 if (m_hasCachedCSSText) { 452 if (m_hasCachedCSSText) {
425 cssTextCache().remove(this); 453 cssTextCache().remove(this);
426 m_hasCachedCSSText = false; 454 m_hasCachedCSSText = false;
427 } 455 }
428 } 456 }
429 457
430 double CSSPrimitiveValue::computeDegrees() 458 double CSSPrimitiveValue::computeDegrees()
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 746
719 String CSSPrimitiveValue::getStringValue(ExceptionCode& ec) const 747 String CSSPrimitiveValue::getStringValue(ExceptionCode& ec) const
720 { 748 {
721 ec = 0; 749 ec = 0;
722 switch (m_primitiveUnitType) { 750 switch (m_primitiveUnitType) {
723 case CSS_STRING: 751 case CSS_STRING:
724 case CSS_ATTR: 752 case CSS_ATTR:
725 case CSS_URI: 753 case CSS_URI:
726 case CSS_VARIABLE_NAME: 754 case CSS_VARIABLE_NAME:
727 return m_value.string; 755 return m_value.string;
728 case CSS_IDENT: 756 case CSS_VALUE_ID:
729 return valueOrPropertyName(m_value.ident); 757 return valueName(m_value.valueID);
758 case CSS_PROPERTY_ID:
759 return propertyName(m_value.propertyID);
730 default: 760 default:
731 ec = INVALID_ACCESS_ERR; 761 ec = INVALID_ACCESS_ERR;
732 break; 762 break;
733 } 763 }
734 764
735 return String(); 765 return String();
736 } 766 }
737 767
738 String CSSPrimitiveValue::getStringValue() const 768 String CSSPrimitiveValue::getStringValue() const
739 { 769 {
740 switch (m_primitiveUnitType) { 770 switch (m_primitiveUnitType) {
741 case CSS_STRING: 771 case CSS_STRING:
742 case CSS_ATTR: 772 case CSS_ATTR:
743 case CSS_URI: 773 case CSS_URI:
744 case CSS_VARIABLE_NAME: 774 case CSS_VARIABLE_NAME:
745 return m_value.string; 775 return m_value.string;
746 case CSS_IDENT: 776 case CSS_VALUE_ID:
747 return valueOrPropertyName(m_value.ident); 777 return valueName(m_value.valueID);
778 case CSS_PROPERTY_ID:
779 return propertyName(m_value.propertyID);
748 default: 780 default:
749 break; 781 break;
750 } 782 }
751 783
752 return String(); 784 return String();
753 } 785 }
754 786
755 Counter* CSSPrimitiveValue::getCounterValue(ExceptionCode& ec) const 787 Counter* CSSPrimitiveValue::getCounterValue(ExceptionCode& ec) const
756 { 788 {
757 ec = 0; 789 ec = 0;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 break; 947 break;
916 case CSS_DIMENSION: 948 case CSS_DIMENSION:
917 text = m_value.string; 949 text = m_value.string;
918 break; 950 break;
919 case CSS_STRING: 951 case CSS_STRING:
920 text = quoteCSSStringIfNeeded(m_value.string); 952 text = quoteCSSStringIfNeeded(m_value.string);
921 break; 953 break;
922 case CSS_URI: 954 case CSS_URI:
923 text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")"; 955 text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")";
924 break; 956 break;
925 case CSS_IDENT: 957 case CSS_VALUE_ID:
926 text = valueOrPropertyName(m_value.ident); 958 text = valueName(m_value.valueID);
959 break;
960 case CSS_PROPERTY_ID:
961 text = propertyName(m_value.propertyID);
927 break; 962 break;
928 case CSS_ATTR: { 963 case CSS_ATTR: {
929 StringBuilder result; 964 StringBuilder result;
930 result.reserveCapacity(6 + m_value.string->length()); 965 result.reserveCapacity(6 + m_value.string->length());
931 result.appendLiteral("attr("); 966 result.appendLiteral("attr(");
932 result.append(m_value.string); 967 result.append(m_value.string);
933 result.append(')'); 968 result.append(')');
934 969
935 text = result.toString(); 970 text = result.toString();
936 break; 971 break;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 } 1033 }
999 1034
1000 result.append(')'); 1035 result.append(')');
1001 text = String::adopt(result); 1036 text = String::adopt(result);
1002 break; 1037 break;
1003 } 1038 }
1004 case CSS_PAIR: 1039 case CSS_PAIR:
1005 text = getPairValue()->cssText(); 1040 text = getPairValue()->cssText();
1006 break; 1041 break;
1007 case CSS_PARSER_OPERATOR: { 1042 case CSS_PARSER_OPERATOR: {
1008 char c = static_cast<char>(m_value.ident); 1043 char c = static_cast<char>(m_value.parserOperator);
1009 text = String(&c, 1U); 1044 text = String(&c, 1U);
1010 break; 1045 break;
1011 } 1046 }
1012 case CSS_PARSER_IDENTIFIER: 1047 case CSS_PARSER_IDENTIFIER:
1013 text = quoteCSSStringIfNeeded(m_value.string); 1048 text = quoteCSSStringIfNeeded(m_value.string);
1014 break; 1049 break;
1015 case CSS_CALC: 1050 case CSS_CALC:
1016 text = m_value.calc->cssText(); 1051 text = m_value.calc->cssText();
1017 break; 1052 break;
1018 case CSS_SHAPE: 1053 case CSS_SHAPE:
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 case CSS_TURN: 1192 case CSS_TURN:
1158 case CSS_VW: 1193 case CSS_VW:
1159 case CSS_VH: 1194 case CSS_VH:
1160 case CSS_VMIN: 1195 case CSS_VMIN:
1161 case CSS_VMAX: 1196 case CSS_VMAX:
1162 case CSS_DPPX: 1197 case CSS_DPPX:
1163 case CSS_DPI: 1198 case CSS_DPI:
1164 case CSS_DPCM: 1199 case CSS_DPCM:
1165 result = CSSPrimitiveValue::create(m_value.num, static_cast<UnitTypes>(m _primitiveUnitType)); 1200 result = CSSPrimitiveValue::create(m_value.num, static_cast<UnitTypes>(m _primitiveUnitType));
1166 break; 1201 break;
1167 case CSS_IDENT: 1202 case CSS_PROPERTY_ID:
1168 result = CSSPrimitiveValue::createIdentifier(m_value.ident); 1203 result = CSSPrimitiveValue::createIdentifier(m_value.propertyID);
1204 break;
1205 case CSS_VALUE_ID:
1206 result = CSSPrimitiveValue::createIdentifier(m_value.valueID);
1169 break; 1207 break;
1170 case CSS_RGBCOLOR: 1208 case CSS_RGBCOLOR:
1171 result = CSSPrimitiveValue::createColor(m_value.rgbcolor); 1209 result = CSSPrimitiveValue::createColor(m_value.rgbcolor);
1172 break; 1210 break;
1173 case CSS_DIMENSION: 1211 case CSS_DIMENSION:
1174 case CSS_UNKNOWN: 1212 case CSS_UNKNOWN:
1175 case CSS_PARSER_OPERATOR: 1213 case CSS_PARSER_OPERATOR:
1176 case CSS_PARSER_IDENTIFIER: 1214 case CSS_PARSER_IDENTIFIER:
1177 case CSS_PARSER_HEXCOLOR: 1215 case CSS_PARSER_HEXCOLOR:
1178 ASSERT_NOT_REACHED(); 1216 ASSERT_NOT_REACHED();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 case CSS_S: 1252 case CSS_S:
1215 case CSS_HZ: 1253 case CSS_HZ:
1216 case CSS_KHZ: 1254 case CSS_KHZ:
1217 case CSS_TURN: 1255 case CSS_TURN:
1218 case CSS_VW: 1256 case CSS_VW:
1219 case CSS_VH: 1257 case CSS_VH:
1220 case CSS_VMIN: 1258 case CSS_VMIN:
1221 case CSS_VMAX: 1259 case CSS_VMAX:
1222 case CSS_DIMENSION: 1260 case CSS_DIMENSION:
1223 return m_value.num == other.m_value.num; 1261 return m_value.num == other.m_value.num;
1224 case CSS_IDENT: 1262 case CSS_PROPERTY_ID:
1225 return valueOrPropertyName(m_value.ident) == valueOrPropertyName(other.m _value.ident); 1263 return propertyName(m_value.propertyID) == propertyName(other.m_value.pr opertyID);
1264 case CSS_VALUE_ID:
1265 return valueName(m_value.valueID) == valueName(other.m_value.valueID);
1226 case CSS_STRING: 1266 case CSS_STRING:
1227 case CSS_URI: 1267 case CSS_URI:
1228 case CSS_ATTR: 1268 case CSS_ATTR:
1229 case CSS_COUNTER_NAME: 1269 case CSS_COUNTER_NAME:
1230 case CSS_PARSER_IDENTIFIER: 1270 case CSS_PARSER_IDENTIFIER:
1231 case CSS_PARSER_HEXCOLOR: 1271 case CSS_PARSER_HEXCOLOR:
1232 case CSS_VARIABLE_NAME: 1272 case CSS_VARIABLE_NAME:
1233 return equal(m_value.string, other.m_value.string); 1273 return equal(m_value.string, other.m_value.string);
1234 case CSS_COUNTER: 1274 case CSS_COUNTER:
1235 return m_value.counter && other.m_value.counter && m_value.counter->equa ls(*other.m_value.counter); 1275 return m_value.counter && other.m_value.counter && m_value.counter->equa ls(*other.m_value.counter);
1236 case CSS_RECT: 1276 case CSS_RECT:
1237 return m_value.rect && other.m_value.rect && m_value.rect->equals(*other .m_value.rect); 1277 return m_value.rect && other.m_value.rect && m_value.rect->equals(*other .m_value.rect);
1238 case CSS_QUAD: 1278 case CSS_QUAD:
1239 return m_value.quad && other.m_value.quad && m_value.quad->equals(*other .m_value.quad); 1279 return m_value.quad && other.m_value.quad && m_value.quad->equals(*other .m_value.quad);
1240 case CSS_RGBCOLOR: 1280 case CSS_RGBCOLOR:
1241 return m_value.rgbcolor == other.m_value.rgbcolor; 1281 return m_value.rgbcolor == other.m_value.rgbcolor;
1242 case CSS_PAIR: 1282 case CSS_PAIR:
1243 return m_value.pair && other.m_value.pair && m_value.pair->equals(*other .m_value.pair); 1283 return m_value.pair && other.m_value.pair && m_value.pair->equals(*other .m_value.pair);
1244 case CSS_PARSER_OPERATOR: 1284 case CSS_PARSER_OPERATOR:
1245 return m_value.ident == other.m_value.ident; 1285 return m_value.valueID == other.m_value.valueID;
1246 case CSS_CALC: 1286 case CSS_CALC:
1247 return m_value.calc && other.m_value.calc && m_value.calc->equals(*other .m_value.calc); 1287 return m_value.calc && other.m_value.calc && m_value.calc->equals(*other .m_value.calc);
1248 case CSS_SHAPE: 1288 case CSS_SHAPE:
1249 return m_value.shape && other.m_value.shape && m_value.shape->equals(*ot her.m_value.shape); 1289 return m_value.shape && other.m_value.shape && m_value.shape->equals(*ot her.m_value.shape);
1250 } 1290 }
1251 return false; 1291 return false;
1252 } 1292 }
1253 1293
1254 void CSSPrimitiveValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje ctInfo) const 1294 void CSSPrimitiveValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje ctInfo) const
1255 { 1295 {
(...skipping 26 matching lines...) Expand all
1282 break; 1322 break;
1283 case CSS_CALC: 1323 case CSS_CALC:
1284 info.addMember(m_value.calc, "value.calc"); 1324 info.addMember(m_value.calc, "value.calc");
1285 break; 1325 break;
1286 default: 1326 default:
1287 break; 1327 break;
1288 } 1328 }
1289 } 1329 }
1290 1330
1291 } // namespace WebCore 1331 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698