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

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

Issue 775153002: Implement unset value handling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 6 years 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
« no previous file with comments | « Source/core/css/CSSValue.h ('k') | Source/core/css/CSSValuePool.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 * 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "core/css/CSSInheritedValue.h" 46 #include "core/css/CSSInheritedValue.h"
47 #include "core/css/CSSInitialValue.h" 47 #include "core/css/CSSInitialValue.h"
48 #include "core/css/CSSLineBoxContainValue.h" 48 #include "core/css/CSSLineBoxContainValue.h"
49 #include "core/css/CSSPrimitiveValue.h" 49 #include "core/css/CSSPrimitiveValue.h"
50 #include "core/css/CSSReflectValue.h" 50 #include "core/css/CSSReflectValue.h"
51 #include "core/css/CSSSVGDocumentValue.h" 51 #include "core/css/CSSSVGDocumentValue.h"
52 #include "core/css/CSSShadowValue.h" 52 #include "core/css/CSSShadowValue.h"
53 #include "core/css/CSSTimingFunctionValue.h" 53 #include "core/css/CSSTimingFunctionValue.h"
54 #include "core/css/CSSTransformValue.h" 54 #include "core/css/CSSTransformValue.h"
55 #include "core/css/CSSUnicodeRangeValue.h" 55 #include "core/css/CSSUnicodeRangeValue.h"
56 #include "core/css/CSSUnsetValue.h"
56 #include "core/css/CSSValueList.h" 57 #include "core/css/CSSValueList.h"
57 58
58 namespace blink { 59 namespace blink {
59 60
60 struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<Sam eSizeAsCSSValue> 61 struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<Sam eSizeAsCSSValue>
61 { 62 {
62 uint32_t bitfields; 63 uint32_t bitfields;
63 }; 64 };
64 65
65 COMPILE_ASSERT(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), CSS_value_should_ stay_small); 66 COMPILE_ASSERT(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), CSS_value_should_ stay_small);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 case RadialGradientClass: 115 case RadialGradientClass:
115 return compareCSSValues<CSSRadialGradientValue>(*this, other); 116 return compareCSSValues<CSSRadialGradientValue>(*this, other);
116 case CrossfadeClass: 117 case CrossfadeClass:
117 return compareCSSValues<CSSCrossfadeValue>(*this, other); 118 return compareCSSValues<CSSCrossfadeValue>(*this, other);
118 case ImageClass: 119 case ImageClass:
119 return compareCSSValues<CSSImageValue>(*this, other); 120 return compareCSSValues<CSSImageValue>(*this, other);
120 case InheritedClass: 121 case InheritedClass:
121 return compareCSSValues<CSSInheritedValue>(*this, other); 122 return compareCSSValues<CSSInheritedValue>(*this, other);
122 case InitialClass: 123 case InitialClass:
123 return compareCSSValues<CSSInitialValue>(*this, other); 124 return compareCSSValues<CSSInitialValue>(*this, other);
125 case UnsetClass:
126 return compareCSSValues<CSSUnsetValue>(*this, other);
124 case GridLineNamesClass: 127 case GridLineNamesClass:
125 return compareCSSValues<CSSGridLineNamesValue>(*this, other); 128 return compareCSSValues<CSSGridLineNamesValue>(*this, other);
126 case GridTemplateAreasClass: 129 case GridTemplateAreasClass:
127 return compareCSSValues<CSSGridTemplateAreasValue>(*this, other); 130 return compareCSSValues<CSSGridTemplateAreasValue>(*this, other);
128 case PrimitiveClass: 131 case PrimitiveClass:
129 return compareCSSValues<CSSPrimitiveValue>(*this, other); 132 return compareCSSValues<CSSPrimitiveValue>(*this, other);
130 case ReflectClass: 133 case ReflectClass:
131 return compareCSSValues<CSSReflectValue>(*this, other); 134 return compareCSSValues<CSSReflectValue>(*this, other);
132 case ShadowClass: 135 case ShadowClass:
133 return compareCSSValues<CSSShadowValue>(*this, other); 136 return compareCSSValues<CSSShadowValue>(*this, other);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 case LinearGradientClass: 187 case LinearGradientClass:
185 return toCSSLinearGradientValue(this)->customCSSText(); 188 return toCSSLinearGradientValue(this)->customCSSText();
186 case RadialGradientClass: 189 case RadialGradientClass:
187 return toCSSRadialGradientValue(this)->customCSSText(); 190 return toCSSRadialGradientValue(this)->customCSSText();
188 case CrossfadeClass: 191 case CrossfadeClass:
189 return toCSSCrossfadeValue(this)->customCSSText(); 192 return toCSSCrossfadeValue(this)->customCSSText();
190 case ImageClass: 193 case ImageClass:
191 return toCSSImageValue(this)->customCSSText(); 194 return toCSSImageValue(this)->customCSSText();
192 case InheritedClass: 195 case InheritedClass:
193 return toCSSInheritedValue(this)->customCSSText(); 196 return toCSSInheritedValue(this)->customCSSText();
197 case UnsetClass:
198 return toCSSUnsetValue(this)->customCSSText();
194 case InitialClass: 199 case InitialClass:
195 return toCSSInitialValue(this)->customCSSText(); 200 return toCSSInitialValue(this)->customCSSText();
196 case GridLineNamesClass: 201 case GridLineNamesClass:
197 return toCSSGridLineNamesValue(this)->customCSSText(); 202 return toCSSGridLineNamesValue(this)->customCSSText();
198 case GridTemplateAreasClass: 203 case GridTemplateAreasClass:
199 return toCSSGridTemplateAreasValue(this)->customCSSText(); 204 return toCSSGridTemplateAreasValue(this)->customCSSText();
200 case PrimitiveClass: 205 case PrimitiveClass:
201 return toCSSPrimitiveValue(this)->customCSSText(); 206 return toCSSPrimitiveValue(this)->customCSSText();
202 case ReflectClass: 207 case ReflectClass:
203 return toCSSReflectValue(this)->customCSSText(); 208 return toCSSReflectValue(this)->customCSSText();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return; 270 return;
266 case ImageClass: 271 case ImageClass:
267 delete toCSSImageValue(this); 272 delete toCSSImageValue(this);
268 return; 273 return;
269 case InheritedClass: 274 case InheritedClass:
270 delete toCSSInheritedValue(this); 275 delete toCSSInheritedValue(this);
271 return; 276 return;
272 case InitialClass: 277 case InitialClass:
273 delete toCSSInitialValue(this); 278 delete toCSSInitialValue(this);
274 return; 279 return;
280 case UnsetClass:
281 delete toCSSUnsetValue(this);
282 return;
275 case GridLineNamesClass: 283 case GridLineNamesClass:
276 delete toCSSGridLineNamesValue(this); 284 delete toCSSGridLineNamesValue(this);
277 return; 285 return;
278 case GridTemplateAreasClass: 286 case GridTemplateAreasClass:
279 delete toCSSGridTemplateAreasValue(this); 287 delete toCSSGridTemplateAreasValue(this);
280 return; 288 return;
281 case PrimitiveClass: 289 case PrimitiveClass:
282 delete toCSSPrimitiveValue(this); 290 delete toCSSPrimitiveValue(this);
283 return; 291 return;
284 case ReflectClass: 292 case ReflectClass:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return; 367 return;
360 case ImageClass: 368 case ImageClass:
361 toCSSImageValue(this)->~CSSImageValue(); 369 toCSSImageValue(this)->~CSSImageValue();
362 return; 370 return;
363 case InheritedClass: 371 case InheritedClass:
364 toCSSInheritedValue(this)->~CSSInheritedValue(); 372 toCSSInheritedValue(this)->~CSSInheritedValue();
365 return; 373 return;
366 case InitialClass: 374 case InitialClass:
367 toCSSInitialValue(this)->~CSSInitialValue(); 375 toCSSInitialValue(this)->~CSSInitialValue();
368 return; 376 return;
377 case UnsetClass:
378 toCSSUnsetValue(this)->~CSSUnsetValue();
379 return;
369 case GridLineNamesClass: 380 case GridLineNamesClass:
370 toCSSGridLineNamesValue(this)->~CSSGridLineNamesValue(); 381 toCSSGridLineNamesValue(this)->~CSSGridLineNamesValue();
371 return; 382 return;
372 case GridTemplateAreasClass: 383 case GridTemplateAreasClass:
373 toCSSGridTemplateAreasValue(this)->~CSSGridTemplateAreasValue(); 384 toCSSGridTemplateAreasValue(this)->~CSSGridTemplateAreasValue();
374 return; 385 return;
375 case PrimitiveClass: 386 case PrimitiveClass:
376 toCSSPrimitiveValue(this)->~CSSPrimitiveValue(); 387 toCSSPrimitiveValue(this)->~CSSPrimitiveValue();
377 return; 388 return;
378 case ReflectClass: 389 case ReflectClass:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 return; 464 return;
454 case ImageClass: 465 case ImageClass:
455 toCSSImageValue(this)->traceAfterDispatch(visitor); 466 toCSSImageValue(this)->traceAfterDispatch(visitor);
456 return; 467 return;
457 case InheritedClass: 468 case InheritedClass:
458 toCSSInheritedValue(this)->traceAfterDispatch(visitor); 469 toCSSInheritedValue(this)->traceAfterDispatch(visitor);
459 return; 470 return;
460 case InitialClass: 471 case InitialClass:
461 toCSSInitialValue(this)->traceAfterDispatch(visitor); 472 toCSSInitialValue(this)->traceAfterDispatch(visitor);
462 return; 473 return;
474 case UnsetClass:
475 toCSSUnsetValue(this)->traceAfterDispatch(visitor);
476 return;
463 case GridLineNamesClass: 477 case GridLineNamesClass:
464 toCSSGridLineNamesValue(this)->traceAfterDispatch(visitor); 478 toCSSGridLineNamesValue(this)->traceAfterDispatch(visitor);
465 return; 479 return;
466 case GridTemplateAreasClass: 480 case GridTemplateAreasClass:
467 toCSSGridTemplateAreasValue(this)->traceAfterDispatch(visitor); 481 toCSSGridTemplateAreasValue(this)->traceAfterDispatch(visitor);
468 return; 482 return;
469 case PrimitiveClass: 483 case PrimitiveClass:
470 toCSSPrimitiveValue(this)->traceAfterDispatch(visitor); 484 toCSSPrimitiveValue(this)->traceAfterDispatch(visitor);
471 return; 485 return;
472 case ReflectClass: 486 case ReflectClass:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); 520 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor);
507 return; 521 return;
508 case CSSContentDistributionClass: 522 case CSSContentDistributionClass:
509 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); 523 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor);
510 return; 524 return;
511 } 525 }
512 ASSERT_NOT_REACHED(); 526 ASSERT_NOT_REACHED();
513 } 527 }
514 528
515 } 529 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSValue.h ('k') | Source/core/css/CSSValuePool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698