OLD | NEW |
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 Loading... |
46 #include "core/css/CSSLineBoxContainValue.h" | 46 #include "core/css/CSSLineBoxContainValue.h" |
47 #include "core/css/CSSPathValue.h" | 47 #include "core/css/CSSPathValue.h" |
48 #include "core/css/CSSPrimitiveValue.h" | 48 #include "core/css/CSSPrimitiveValue.h" |
49 #include "core/css/CSSReflectValue.h" | 49 #include "core/css/CSSReflectValue.h" |
50 #include "core/css/CSSSVGDocumentValue.h" | 50 #include "core/css/CSSSVGDocumentValue.h" |
51 #include "core/css/CSSShadowValue.h" | 51 #include "core/css/CSSShadowValue.h" |
52 #include "core/css/CSSTimingFunctionValue.h" | 52 #include "core/css/CSSTimingFunctionValue.h" |
53 #include "core/css/CSSUnicodeRangeValue.h" | 53 #include "core/css/CSSUnicodeRangeValue.h" |
54 #include "core/css/CSSUnsetValue.h" | 54 #include "core/css/CSSUnsetValue.h" |
55 #include "core/css/CSSValueList.h" | 55 #include "core/css/CSSValueList.h" |
| 56 #include "core/css/CSSVariableValue.h" |
56 | 57 |
57 namespace blink { | 58 namespace blink { |
58 | 59 |
59 struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<Sam
eSizeAsCSSValue> | 60 struct SameSizeAsCSSValue : public RefCountedWillBeGarbageCollectedFinalized<Sam
eSizeAsCSSValue> |
60 { | 61 { |
61 uint32_t bitfields; | 62 uint32_t bitfields; |
62 }; | 63 }; |
63 | 64 |
64 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s
tay small"); | 65 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s
tay small"); |
65 | 66 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 case LineBoxContainClass: | 144 case LineBoxContainClass: |
144 return compareCSSValues<CSSLineBoxContainValue>(*this, other); | 145 return compareCSSValues<CSSLineBoxContainValue>(*this, other); |
145 case CalculationClass: | 146 case CalculationClass: |
146 return compareCSSValues<CSSCalcValue>(*this, other); | 147 return compareCSSValues<CSSCalcValue>(*this, other); |
147 case ImageSetClass: | 148 case ImageSetClass: |
148 return compareCSSValues<CSSImageSetValue>(*this, other); | 149 return compareCSSValues<CSSImageSetValue>(*this, other); |
149 case CSSSVGDocumentClass: | 150 case CSSSVGDocumentClass: |
150 return compareCSSValues<CSSSVGDocumentValue>(*this, other); | 151 return compareCSSValues<CSSSVGDocumentValue>(*this, other); |
151 case CSSContentDistributionClass: | 152 case CSSContentDistributionClass: |
152 return compareCSSValues<CSSContentDistributionValue>(*this, other); | 153 return compareCSSValues<CSSContentDistributionValue>(*this, other); |
| 154 case VariableClass: |
| 155 return compareCSSValues<CSSVariableValue>(*this, other); |
153 default: | 156 default: |
154 ASSERT_NOT_REACHED(); | 157 ASSERT_NOT_REACHED(); |
155 return false; | 158 return false; |
156 } | 159 } |
157 } | 160 } |
158 return false; | 161 return false; |
159 } | 162 } |
160 | 163 |
161 String CSSValue::cssText() const | 164 String CSSValue::cssText() const |
162 { | 165 { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 case LineBoxContainClass: | 213 case LineBoxContainClass: |
211 return toCSSLineBoxContainValue(this)->customCSSText(); | 214 return toCSSLineBoxContainValue(this)->customCSSText(); |
212 case CalculationClass: | 215 case CalculationClass: |
213 return toCSSCalcValue(this)->customCSSText(); | 216 return toCSSCalcValue(this)->customCSSText(); |
214 case ImageSetClass: | 217 case ImageSetClass: |
215 return toCSSImageSetValue(this)->customCSSText(); | 218 return toCSSImageSetValue(this)->customCSSText(); |
216 case CSSSVGDocumentClass: | 219 case CSSSVGDocumentClass: |
217 return toCSSSVGDocumentValue(this)->customCSSText(); | 220 return toCSSSVGDocumentValue(this)->customCSSText(); |
218 case CSSContentDistributionClass: | 221 case CSSContentDistributionClass: |
219 return toCSSContentDistributionValue(this)->customCSSText(); | 222 return toCSSContentDistributionValue(this)->customCSSText(); |
| 223 case VariableClass: |
| 224 return String(); |
220 } | 225 } |
221 ASSERT_NOT_REACHED(); | 226 ASSERT_NOT_REACHED(); |
222 return String(); | 227 return String(); |
223 } | 228 } |
224 | 229 |
225 void CSSValue::destroy() | 230 void CSSValue::destroy() |
226 { | 231 { |
227 switch (classType()) { | 232 switch (classType()) { |
228 case BorderImageSliceClass: | 233 case BorderImageSliceClass: |
229 delete toCSSBorderImageSliceValue(this); | 234 delete toCSSBorderImageSliceValue(this); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 return; | 307 return; |
303 case ImageSetClass: | 308 case ImageSetClass: |
304 delete toCSSImageSetValue(this); | 309 delete toCSSImageSetValue(this); |
305 return; | 310 return; |
306 case CSSSVGDocumentClass: | 311 case CSSSVGDocumentClass: |
307 delete toCSSSVGDocumentValue(this); | 312 delete toCSSSVGDocumentValue(this); |
308 return; | 313 return; |
309 case CSSContentDistributionClass: | 314 case CSSContentDistributionClass: |
310 delete toCSSContentDistributionValue(this); | 315 delete toCSSContentDistributionValue(this); |
311 return; | 316 return; |
| 317 case VariableClass: |
| 318 delete toCSSVariableValue(this); |
| 319 return; |
312 } | 320 } |
313 ASSERT_NOT_REACHED(); | 321 ASSERT_NOT_REACHED(); |
314 } | 322 } |
315 | 323 |
316 void CSSValue::finalizeGarbageCollectedObject() | 324 void CSSValue::finalizeGarbageCollectedObject() |
317 { | 325 { |
318 switch (classType()) { | 326 switch (classType()) { |
319 case BorderImageSliceClass: | 327 case BorderImageSliceClass: |
320 toCSSBorderImageSliceValue(this)->~CSSBorderImageSliceValue(); | 328 toCSSBorderImageSliceValue(this)->~CSSBorderImageSliceValue(); |
321 return; | 329 return; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 return; | 401 return; |
394 case ImageSetClass: | 402 case ImageSetClass: |
395 toCSSImageSetValue(this)->~CSSImageSetValue(); | 403 toCSSImageSetValue(this)->~CSSImageSetValue(); |
396 return; | 404 return; |
397 case CSSSVGDocumentClass: | 405 case CSSSVGDocumentClass: |
398 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); | 406 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); |
399 return; | 407 return; |
400 case CSSContentDistributionClass: | 408 case CSSContentDistributionClass: |
401 toCSSContentDistributionValue(this)->~CSSContentDistributionValue(); | 409 toCSSContentDistributionValue(this)->~CSSContentDistributionValue(); |
402 return; | 410 return; |
| 411 case VariableClass: |
| 412 return; |
403 } | 413 } |
404 ASSERT_NOT_REACHED(); | 414 ASSERT_NOT_REACHED(); |
405 } | 415 } |
406 | 416 |
407 DEFINE_TRACE(CSSValue) | 417 DEFINE_TRACE(CSSValue) |
408 { | 418 { |
409 switch (classType()) { | 419 switch (classType()) { |
410 case BorderImageSliceClass: | 420 case BorderImageSliceClass: |
411 toCSSBorderImageSliceValue(this)->traceAfterDispatch(visitor); | 421 toCSSBorderImageSliceValue(this)->traceAfterDispatch(visitor); |
412 return; | 422 return; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 return; | 494 return; |
485 case ImageSetClass: | 495 case ImageSetClass: |
486 toCSSImageSetValue(this)->traceAfterDispatch(visitor); | 496 toCSSImageSetValue(this)->traceAfterDispatch(visitor); |
487 return; | 497 return; |
488 case CSSSVGDocumentClass: | 498 case CSSSVGDocumentClass: |
489 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); | 499 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); |
490 return; | 500 return; |
491 case CSSContentDistributionClass: | 501 case CSSContentDistributionClass: |
492 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); | 502 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); |
493 return; | 503 return; |
| 504 case VariableClass: |
| 505 return; |
494 } | 506 } |
495 ASSERT_NOT_REACHED(); | 507 ASSERT_NOT_REACHED(); |
496 } | 508 } |
497 | 509 |
498 } | 510 } |
OLD | NEW |