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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSValue.cpp

Issue 1406993009: Revert "CSS Custom Properties (Variables)" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 17 matching lines...) Expand all
28 #include "core/css/CSSValue.h" 28 #include "core/css/CSSValue.h"
29 29
30 #include "core/css/CSSBasicShapeValues.h" 30 #include "core/css/CSSBasicShapeValues.h"
31 #include "core/css/CSSBorderImageSliceValue.h" 31 #include "core/css/CSSBorderImageSliceValue.h"
32 #include "core/css/CSSColorValue.h" 32 #include "core/css/CSSColorValue.h"
33 #include "core/css/CSSContentDistributionValue.h" 33 #include "core/css/CSSContentDistributionValue.h"
34 #include "core/css/CSSCounterValue.h" 34 #include "core/css/CSSCounterValue.h"
35 #include "core/css/CSSCrossfadeValue.h" 35 #include "core/css/CSSCrossfadeValue.h"
36 #include "core/css/CSSCursorImageValue.h" 36 #include "core/css/CSSCursorImageValue.h"
37 #include "core/css/CSSCustomIdentValue.h" 37 #include "core/css/CSSCustomIdentValue.h"
38 #include "core/css/CSSCustomPropertyDeclaration.h"
39 #include "core/css/CSSFontFaceSrcValue.h" 38 #include "core/css/CSSFontFaceSrcValue.h"
40 #include "core/css/CSSFontFeatureValue.h" 39 #include "core/css/CSSFontFeatureValue.h"
41 #include "core/css/CSSFunctionValue.h" 40 #include "core/css/CSSFunctionValue.h"
42 #include "core/css/CSSGradientValue.h" 41 #include "core/css/CSSGradientValue.h"
43 #include "core/css/CSSGridLineNamesValue.h" 42 #include "core/css/CSSGridLineNamesValue.h"
44 #include "core/css/CSSGridTemplateAreasValue.h" 43 #include "core/css/CSSGridTemplateAreasValue.h"
45 #include "core/css/CSSImageSetValue.h" 44 #include "core/css/CSSImageSetValue.h"
46 #include "core/css/CSSImageValue.h" 45 #include "core/css/CSSImageValue.h"
47 #include "core/css/CSSInheritedValue.h" 46 #include "core/css/CSSInheritedValue.h"
48 #include "core/css/CSSInitialValue.h" 47 #include "core/css/CSSInitialValue.h"
49 #include "core/css/CSSPathValue.h" 48 #include "core/css/CSSPathValue.h"
50 #include "core/css/CSSPrimitiveValue.h" 49 #include "core/css/CSSPrimitiveValue.h"
51 #include "core/css/CSSQuadValue.h" 50 #include "core/css/CSSQuadValue.h"
52 #include "core/css/CSSReflectValue.h" 51 #include "core/css/CSSReflectValue.h"
53 #include "core/css/CSSSVGDocumentValue.h" 52 #include "core/css/CSSSVGDocumentValue.h"
54 #include "core/css/CSSShadowValue.h" 53 #include "core/css/CSSShadowValue.h"
55 #include "core/css/CSSStringValue.h" 54 #include "core/css/CSSStringValue.h"
56 #include "core/css/CSSTimingFunctionValue.h" 55 #include "core/css/CSSTimingFunctionValue.h"
57 #include "core/css/CSSURIValue.h" 56 #include "core/css/CSSURIValue.h"
58 #include "core/css/CSSUnicodeRangeValue.h" 57 #include "core/css/CSSUnicodeRangeValue.h"
59 #include "core/css/CSSUnsetValue.h" 58 #include "core/css/CSSUnsetValue.h"
60 #include "core/css/CSSValueList.h" 59 #include "core/css/CSSValueList.h"
61 #include "core/css/CSSValuePair.h" 60 #include "core/css/CSSValuePair.h"
62 #include "core/css/CSSVariableReferenceValue.h"
63 61
64 namespace blink { 62 namespace blink {
65 63
66 struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<Sam eSizeAsCSSValue> { 64 struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<Sam eSizeAsCSSValue> {
67 uint32_t bitfields; 65 uint32_t bitfields;
68 }; 66 };
69 67
70 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s tay small"); 68 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s tay small");
71 69
72 bool CSSValue::isImplicitInitialValue() const 70 bool CSSValue::isImplicitInitialValue() const
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 case ValueListClass: 163 case ValueListClass:
166 return compareCSSValues<CSSValueList>(*this, other); 164 return compareCSSValues<CSSValueList>(*this, other);
167 case ValuePairClass: 165 case ValuePairClass:
168 return compareCSSValues<CSSValuePair>(*this, other); 166 return compareCSSValues<CSSValuePair>(*this, other);
169 case ImageSetClass: 167 case ImageSetClass:
170 return compareCSSValues<CSSImageSetValue>(*this, other); 168 return compareCSSValues<CSSImageSetValue>(*this, other);
171 case CSSSVGDocumentClass: 169 case CSSSVGDocumentClass:
172 return compareCSSValues<CSSSVGDocumentValue>(*this, other); 170 return compareCSSValues<CSSSVGDocumentValue>(*this, other);
173 case CSSContentDistributionClass: 171 case CSSContentDistributionClass:
174 return compareCSSValues<CSSContentDistributionValue>(*this, other); 172 return compareCSSValues<CSSContentDistributionValue>(*this, other);
175 case CustomPropertyDeclarationClass:
176 return compareCSSValues<CSSCustomPropertyDeclaration>(*this, other);
177 case VariableReferenceClass:
178 return compareCSSValues<CSSVariableReferenceValue>(*this, other);
179 } 173 }
180 ASSERT_NOT_REACHED(); 174 ASSERT_NOT_REACHED();
181 return false; 175 return false;
182 } 176 }
183 return false; 177 return false;
184 } 178 }
185 179
186 String CSSValue::cssText() const 180 String CSSValue::cssText() const
187 { 181 {
188 switch (classType()) { 182 switch (classType()) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 case ValuePairClass: 245 case ValuePairClass:
252 return toCSSValuePair(this)->customCSSText(); 246 return toCSSValuePair(this)->customCSSText();
253 case ValueListClass: 247 case ValueListClass:
254 return toCSSValueList(this)->customCSSText(); 248 return toCSSValueList(this)->customCSSText();
255 case ImageSetClass: 249 case ImageSetClass:
256 return toCSSImageSetValue(this)->customCSSText(); 250 return toCSSImageSetValue(this)->customCSSText();
257 case CSSSVGDocumentClass: 251 case CSSSVGDocumentClass:
258 return toCSSSVGDocumentValue(this)->customCSSText(); 252 return toCSSSVGDocumentValue(this)->customCSSText();
259 case CSSContentDistributionClass: 253 case CSSContentDistributionClass:
260 return toCSSContentDistributionValue(this)->customCSSText(); 254 return toCSSContentDistributionValue(this)->customCSSText();
261 case VariableReferenceClass:
262 return toCSSVariableReferenceValue(this)->customCSSText();
263 case CustomPropertyDeclarationClass:
264 // TODO(leviw): We don't allow custom properties in CSSOM yet
265 ASSERT_NOT_REACHED();
266 } 255 }
267 ASSERT_NOT_REACHED(); 256 ASSERT_NOT_REACHED();
268 return String(); 257 return String();
269 } 258 }
270 259
271 void CSSValue::destroy() 260 void CSSValue::destroy()
272 { 261 {
273 switch (classType()) { 262 switch (classType()) {
274 case BasicShapeCircleClass: 263 case BasicShapeCircleClass:
275 delete toCSSBasicShapeCircleValue(this); 264 delete toCSSBasicShapeCircleValue(this);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 return; 361 return;
373 case ImageSetClass: 362 case ImageSetClass:
374 delete toCSSImageSetValue(this); 363 delete toCSSImageSetValue(this);
375 return; 364 return;
376 case CSSSVGDocumentClass: 365 case CSSSVGDocumentClass:
377 delete toCSSSVGDocumentValue(this); 366 delete toCSSSVGDocumentValue(this);
378 return; 367 return;
379 case CSSContentDistributionClass: 368 case CSSContentDistributionClass:
380 delete toCSSContentDistributionValue(this); 369 delete toCSSContentDistributionValue(this);
381 return; 370 return;
382 case VariableReferenceClass:
383 delete toCSSVariableReferenceValue(this);
384 return;
385 case CustomPropertyDeclarationClass:
386 delete toCSSCustomPropertyDeclaration(this);
387 return;
388 } 371 }
389 ASSERT_NOT_REACHED(); 372 ASSERT_NOT_REACHED();
390 } 373 }
391 374
392 void CSSValue::finalizeGarbageCollectedObject() 375 void CSSValue::finalizeGarbageCollectedObject()
393 { 376 {
394 switch (classType()) { 377 switch (classType()) {
395 case BasicShapeCircleClass: 378 case BasicShapeCircleClass:
396 toCSSBasicShapeCircleValue(this)->~CSSBasicShapeCircleValue(); 379 toCSSBasicShapeCircleValue(this)->~CSSBasicShapeCircleValue();
397 return; 380 return;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 return; 476 return;
494 case ImageSetClass: 477 case ImageSetClass:
495 toCSSImageSetValue(this)->~CSSImageSetValue(); 478 toCSSImageSetValue(this)->~CSSImageSetValue();
496 return; 479 return;
497 case CSSSVGDocumentClass: 480 case CSSSVGDocumentClass:
498 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); 481 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue();
499 return; 482 return;
500 case CSSContentDistributionClass: 483 case CSSContentDistributionClass:
501 toCSSContentDistributionValue(this)->~CSSContentDistributionValue(); 484 toCSSContentDistributionValue(this)->~CSSContentDistributionValue();
502 return; 485 return;
503 case VariableReferenceClass:
504 toCSSVariableReferenceValue(this)->~CSSVariableReferenceValue();
505 return;
506 case CustomPropertyDeclarationClass:
507 toCSSCustomPropertyDeclaration(this)->~CSSCustomPropertyDeclaration();
508 return;
509 } 486 }
510 ASSERT_NOT_REACHED(); 487 ASSERT_NOT_REACHED();
511 } 488 }
512 489
513 DEFINE_TRACE(CSSValue) 490 DEFINE_TRACE(CSSValue)
514 { 491 {
515 switch (classType()) { 492 switch (classType()) {
516 case BasicShapeCircleClass: 493 case BasicShapeCircleClass:
517 toCSSBasicShapeCircleValue(this)->traceAfterDispatch(visitor); 494 toCSSBasicShapeCircleValue(this)->traceAfterDispatch(visitor);
518 return; 495 return;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 return; 591 return;
615 case ImageSetClass: 592 case ImageSetClass:
616 toCSSImageSetValue(this)->traceAfterDispatch(visitor); 593 toCSSImageSetValue(this)->traceAfterDispatch(visitor);
617 return; 594 return;
618 case CSSSVGDocumentClass: 595 case CSSSVGDocumentClass:
619 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); 596 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor);
620 return; 597 return;
621 case CSSContentDistributionClass: 598 case CSSContentDistributionClass:
622 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); 599 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor);
623 return; 600 return;
624 case VariableReferenceClass:
625 toCSSVariableReferenceValue(this)->traceAfterDispatch(visitor);
626 return;
627 case CustomPropertyDeclarationClass:
628 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor);
629 return;
630 } 601 }
631 ASSERT_NOT_REACHED(); 602 ASSERT_NOT_REACHED();
632 } 603 }
633 604
634 } 605 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.h ('k') | third_party/WebKit/Source/core/css/CSSValueKeywords.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698