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

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

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToTed Created 5 years, 4 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
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 14 matching lines...) Expand all
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/css/CSSValue.h" 28 #include "core/css/CSSValue.h"
29 29
30 #include "core/css/CSSBorderImageSliceValue.h" 30 #include "core/css/CSSBorderImageSliceValue.h"
31 #include "core/css/CSSCanvasValue.h" 31 #include "core/css/CSSCanvasValue.h"
32 #include "core/css/CSSContentDistributionValue.h" 32 #include "core/css/CSSContentDistributionValue.h"
33 #include "core/css/CSSCrossfadeValue.h" 33 #include "core/css/CSSCrossfadeValue.h"
34 #include "core/css/CSSCursorImageValue.h" 34 #include "core/css/CSSCursorImageValue.h"
35 #include "core/css/CSSCustomVariableValue.h"
35 #include "core/css/CSSFontFaceSrcValue.h" 36 #include "core/css/CSSFontFaceSrcValue.h"
36 #include "core/css/CSSFontFeatureValue.h" 37 #include "core/css/CSSFontFeatureValue.h"
37 #include "core/css/CSSFunctionValue.h" 38 #include "core/css/CSSFunctionValue.h"
38 #include "core/css/CSSGradientValue.h" 39 #include "core/css/CSSGradientValue.h"
39 #include "core/css/CSSGridLineNamesValue.h" 40 #include "core/css/CSSGridLineNamesValue.h"
40 #include "core/css/CSSGridTemplateAreasValue.h" 41 #include "core/css/CSSGridTemplateAreasValue.h"
41 #include "core/css/CSSImageSetValue.h" 42 #include "core/css/CSSImageSetValue.h"
42 #include "core/css/CSSImageValue.h" 43 #include "core/css/CSSImageValue.h"
43 #include "core/css/CSSInheritedValue.h" 44 #include "core/css/CSSInheritedValue.h"
44 #include "core/css/CSSInitialValue.h" 45 #include "core/css/CSSInitialValue.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 case ValueListClass: 140 case ValueListClass:
140 return compareCSSValues<CSSValueList>(*this, other); 141 return compareCSSValues<CSSValueList>(*this, other);
141 case LineBoxContainClass: 142 case LineBoxContainClass:
142 return compareCSSValues<CSSLineBoxContainValue>(*this, other); 143 return compareCSSValues<CSSLineBoxContainValue>(*this, other);
143 case ImageSetClass: 144 case ImageSetClass:
144 return compareCSSValues<CSSImageSetValue>(*this, other); 145 return compareCSSValues<CSSImageSetValue>(*this, other);
145 case CSSSVGDocumentClass: 146 case CSSSVGDocumentClass:
146 return compareCSSValues<CSSSVGDocumentValue>(*this, other); 147 return compareCSSValues<CSSSVGDocumentValue>(*this, other);
147 case CSSContentDistributionClass: 148 case CSSContentDistributionClass:
148 return compareCSSValues<CSSContentDistributionValue>(*this, other); 149 return compareCSSValues<CSSContentDistributionValue>(*this, other);
150 case VariableClass:
151 return compareCSSValues<CSSCustomVariableValue>(*this, other);
149 default: 152 default:
150 ASSERT_NOT_REACHED(); 153 ASSERT_NOT_REACHED();
151 return false; 154 return false;
152 } 155 }
153 } 156 }
154 return false; 157 return false;
155 } 158 }
156 159
157 String CSSValue::cssText() const 160 String CSSValue::cssText() const
158 { 161 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 case ValueListClass: 207 case ValueListClass:
205 return toCSSValueList(this)->customCSSText(); 208 return toCSSValueList(this)->customCSSText();
206 case LineBoxContainClass: 209 case LineBoxContainClass:
207 return toCSSLineBoxContainValue(this)->customCSSText(); 210 return toCSSLineBoxContainValue(this)->customCSSText();
208 case ImageSetClass: 211 case ImageSetClass:
209 return toCSSImageSetValue(this)->customCSSText(); 212 return toCSSImageSetValue(this)->customCSSText();
210 case CSSSVGDocumentClass: 213 case CSSSVGDocumentClass:
211 return toCSSSVGDocumentValue(this)->customCSSText(); 214 return toCSSSVGDocumentValue(this)->customCSSText();
212 case CSSContentDistributionClass: 215 case CSSContentDistributionClass:
213 return toCSSContentDistributionValue(this)->customCSSText(); 216 return toCSSContentDistributionValue(this)->customCSSText();
217 case VariableClass:
218 return String();
Timothy Loh 2015/08/25 09:21:09 We don't get here yet, right? // TODO(leviw): We
214 } 219 }
215 ASSERT_NOT_REACHED(); 220 ASSERT_NOT_REACHED();
216 return String(); 221 return String();
217 } 222 }
218 223
219 void CSSValue::destroy() 224 void CSSValue::destroy()
220 { 225 {
221 switch (classType()) { 226 switch (classType()) {
222 case BorderImageSliceClass: 227 case BorderImageSliceClass:
223 delete toCSSBorderImageSliceValue(this); 228 delete toCSSBorderImageSliceValue(this);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 return; 298 return;
294 case ImageSetClass: 299 case ImageSetClass:
295 delete toCSSImageSetValue(this); 300 delete toCSSImageSetValue(this);
296 return; 301 return;
297 case CSSSVGDocumentClass: 302 case CSSSVGDocumentClass:
298 delete toCSSSVGDocumentValue(this); 303 delete toCSSSVGDocumentValue(this);
299 return; 304 return;
300 case CSSContentDistributionClass: 305 case CSSContentDistributionClass:
301 delete toCSSContentDistributionValue(this); 306 delete toCSSContentDistributionValue(this);
302 return; 307 return;
308 case VariableClass:
309 delete toCSSCustomVariableValue(this);
310 return;
303 } 311 }
304 ASSERT_NOT_REACHED(); 312 ASSERT_NOT_REACHED();
305 } 313 }
306 314
307 void CSSValue::finalizeGarbageCollectedObject() 315 void CSSValue::finalizeGarbageCollectedObject()
308 { 316 {
309 switch (classType()) { 317 switch (classType()) {
310 case BorderImageSliceClass: 318 case BorderImageSliceClass:
311 toCSSBorderImageSliceValue(this)->~CSSBorderImageSliceValue(); 319 toCSSBorderImageSliceValue(this)->~CSSBorderImageSliceValue();
312 return; 320 return;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 return; 389 return;
382 case ImageSetClass: 390 case ImageSetClass:
383 toCSSImageSetValue(this)->~CSSImageSetValue(); 391 toCSSImageSetValue(this)->~CSSImageSetValue();
384 return; 392 return;
385 case CSSSVGDocumentClass: 393 case CSSSVGDocumentClass:
386 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); 394 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue();
387 return; 395 return;
388 case CSSContentDistributionClass: 396 case CSSContentDistributionClass:
389 toCSSContentDistributionValue(this)->~CSSContentDistributionValue(); 397 toCSSContentDistributionValue(this)->~CSSContentDistributionValue();
390 return; 398 return;
399 case VariableClass:
400 return;
391 } 401 }
392 ASSERT_NOT_REACHED(); 402 ASSERT_NOT_REACHED();
393 } 403 }
394 404
395 DEFINE_TRACE(CSSValue) 405 DEFINE_TRACE(CSSValue)
396 { 406 {
397 switch (classType()) { 407 switch (classType()) {
398 case BorderImageSliceClass: 408 case BorderImageSliceClass:
399 toCSSBorderImageSliceValue(this)->traceAfterDispatch(visitor); 409 toCSSBorderImageSliceValue(this)->traceAfterDispatch(visitor);
400 return; 410 return;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return; 479 return;
470 case ImageSetClass: 480 case ImageSetClass:
471 toCSSImageSetValue(this)->traceAfterDispatch(visitor); 481 toCSSImageSetValue(this)->traceAfterDispatch(visitor);
472 return; 482 return;
473 case CSSSVGDocumentClass: 483 case CSSSVGDocumentClass:
474 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); 484 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor);
475 return; 485 return;
476 case CSSContentDistributionClass: 486 case CSSContentDistributionClass:
477 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); 487 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor);
478 return; 488 return;
489 case VariableClass:
490 return;
479 } 491 }
480 ASSERT_NOT_REACHED(); 492 ASSERT_NOT_REACHED();
481 } 493 }
482 494
483 } 495 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698