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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 bool CSSValue::isImplicitInitialValue() const | 71 bool CSSValue::isImplicitInitialValue() const |
72 { | 72 { |
73 return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit(); | 73 return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit(); |
74 } | 74 } |
75 | 75 |
76 bool CSSValue::hasFailedOrCanceledSubresources() const | 76 bool CSSValue::hasFailedOrCanceledSubresources() const |
77 { | 77 { |
78 if (isValueList()) | 78 if (isValueList()) |
79 return toCSSValueList(this)->hasFailedOrCanceledSubresources(); | 79 return toCSSValueList(this)->hasFailedOrCanceledSubresources(); |
80 if (classType() == FontFaceSrcClass) | 80 if (getClassType() == FontFaceSrcClass) |
81 return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources(); | 81 return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources(); |
82 if (classType() == ImageClass) | 82 if (getClassType() == ImageClass) |
83 return toCSSImageValue(this)->hasFailedOrCanceledSubresources(); | 83 return toCSSImageValue(this)->hasFailedOrCanceledSubresources(); |
84 if (classType() == CrossfadeClass) | 84 if (getClassType() == CrossfadeClass) |
85 return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources(); | 85 return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources(); |
86 if (classType() == ImageSetClass) | 86 if (getClassType() == ImageSetClass) |
87 return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources(); | 87 return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources(); |
88 | 88 |
89 return false; | 89 return false; |
90 } | 90 } |
91 | 91 |
92 template<class ChildClassType> | 92 template<class ChildClassType> |
93 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& secon
d) | 93 inline static bool compareCSSValues(const CSSValue& first, const CSSValue& secon
d) |
94 { | 94 { |
95 return static_cast<const ChildClassType&>(first).equals(static_cast<const Ch
ildClassType&>(second)); | 95 return static_cast<const ChildClassType&>(first).equals(static_cast<const Ch
ildClassType&>(second)); |
96 } | 96 } |
97 | 97 |
98 bool CSSValue::equals(const CSSValue& other) const | 98 bool CSSValue::equals(const CSSValue& other) const |
99 { | 99 { |
100 if (m_classType == other.m_classType) { | 100 if (m_classType == other.m_classType) { |
101 switch (classType()) { | 101 switch (getClassType()) { |
102 case BasicShapeCircleClass: | 102 case BasicShapeCircleClass: |
103 return compareCSSValues<CSSBasicShapeCircleValue>(*this, other); | 103 return compareCSSValues<CSSBasicShapeCircleValue>(*this, other); |
104 case BasicShapeEllipseClass: | 104 case BasicShapeEllipseClass: |
105 return compareCSSValues<CSSBasicShapeEllipseValue>(*this, other); | 105 return compareCSSValues<CSSBasicShapeEllipseValue>(*this, other); |
106 case BasicShapePolygonClass: | 106 case BasicShapePolygonClass: |
107 return compareCSSValues<CSSBasicShapePolygonValue>(*this, other); | 107 return compareCSSValues<CSSBasicShapePolygonValue>(*this, other); |
108 case BasicShapeInsetClass: | 108 case BasicShapeInsetClass: |
109 return compareCSSValues<CSSBasicShapeInsetValue>(*this, other); | 109 return compareCSSValues<CSSBasicShapeInsetValue>(*this, other); |
110 case BorderImageSliceClass: | 110 case BorderImageSliceClass: |
111 return compareCSSValues<CSSBorderImageSliceValue>(*this, other); | 111 return compareCSSValues<CSSBorderImageSliceValue>(*this, other); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 return compareCSSValues<CSSVariableReferenceValue>(*this, other); | 177 return compareCSSValues<CSSVariableReferenceValue>(*this, other); |
178 } | 178 } |
179 ASSERT_NOT_REACHED(); | 179 ASSERT_NOT_REACHED(); |
180 return false; | 180 return false; |
181 } | 181 } |
182 return false; | 182 return false; |
183 } | 183 } |
184 | 184 |
185 String CSSValue::cssText() const | 185 String CSSValue::cssText() const |
186 { | 186 { |
187 switch (classType()) { | 187 switch (getClassType()) { |
188 case BasicShapeCircleClass: | 188 case BasicShapeCircleClass: |
189 return toCSSBasicShapeCircleValue(this)->customCSSText(); | 189 return toCSSBasicShapeCircleValue(this)->customCSSText(); |
190 case BasicShapeEllipseClass: | 190 case BasicShapeEllipseClass: |
191 return toCSSBasicShapeEllipseValue(this)->customCSSText(); | 191 return toCSSBasicShapeEllipseValue(this)->customCSSText(); |
192 case BasicShapePolygonClass: | 192 case BasicShapePolygonClass: |
193 return toCSSBasicShapePolygonValue(this)->customCSSText(); | 193 return toCSSBasicShapePolygonValue(this)->customCSSText(); |
194 case BasicShapeInsetClass: | 194 case BasicShapeInsetClass: |
195 return toCSSBasicShapeInsetValue(this)->customCSSText(); | 195 return toCSSBasicShapeInsetValue(this)->customCSSText(); |
196 case BorderImageSliceClass: | 196 case BorderImageSliceClass: |
197 return toCSSBorderImageSliceValue(this)->customCSSText(); | 197 return toCSSBorderImageSliceValue(this)->customCSSText(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return toCSSVariableReferenceValue(this)->customCSSText(); | 261 return toCSSVariableReferenceValue(this)->customCSSText(); |
262 case CustomPropertyDeclarationClass: | 262 case CustomPropertyDeclarationClass: |
263 return toCSSCustomPropertyDeclaration(this)->customCSSText(); | 263 return toCSSCustomPropertyDeclaration(this)->customCSSText(); |
264 } | 264 } |
265 ASSERT_NOT_REACHED(); | 265 ASSERT_NOT_REACHED(); |
266 return String(); | 266 return String(); |
267 } | 267 } |
268 | 268 |
269 void CSSValue::destroy() | 269 void CSSValue::destroy() |
270 { | 270 { |
271 switch (classType()) { | 271 switch (getClassType()) { |
272 case BasicShapeCircleClass: | 272 case BasicShapeCircleClass: |
273 delete toCSSBasicShapeCircleValue(this); | 273 delete toCSSBasicShapeCircleValue(this); |
274 return; | 274 return; |
275 case BasicShapeEllipseClass: | 275 case BasicShapeEllipseClass: |
276 delete toCSSBasicShapeEllipseValue(this); | 276 delete toCSSBasicShapeEllipseValue(this); |
277 return; | 277 return; |
278 case BasicShapePolygonClass: | 278 case BasicShapePolygonClass: |
279 delete toCSSBasicShapePolygonValue(this); | 279 delete toCSSBasicShapePolygonValue(this); |
280 return; | 280 return; |
281 case BasicShapeInsetClass: | 281 case BasicShapeInsetClass: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 return; | 382 return; |
383 case CustomPropertyDeclarationClass: | 383 case CustomPropertyDeclarationClass: |
384 delete toCSSCustomPropertyDeclaration(this); | 384 delete toCSSCustomPropertyDeclaration(this); |
385 return; | 385 return; |
386 } | 386 } |
387 ASSERT_NOT_REACHED(); | 387 ASSERT_NOT_REACHED(); |
388 } | 388 } |
389 | 389 |
390 void CSSValue::finalizeGarbageCollectedObject() | 390 void CSSValue::finalizeGarbageCollectedObject() |
391 { | 391 { |
392 switch (classType()) { | 392 switch (getClassType()) { |
393 case BasicShapeCircleClass: | 393 case BasicShapeCircleClass: |
394 toCSSBasicShapeCircleValue(this)->~CSSBasicShapeCircleValue(); | 394 toCSSBasicShapeCircleValue(this)->~CSSBasicShapeCircleValue(); |
395 return; | 395 return; |
396 case BasicShapeEllipseClass: | 396 case BasicShapeEllipseClass: |
397 toCSSBasicShapeEllipseValue(this)->~CSSBasicShapeEllipseValue(); | 397 toCSSBasicShapeEllipseValue(this)->~CSSBasicShapeEllipseValue(); |
398 return; | 398 return; |
399 case BasicShapePolygonClass: | 399 case BasicShapePolygonClass: |
400 toCSSBasicShapePolygonValue(this)->~CSSBasicShapePolygonValue(); | 400 toCSSBasicShapePolygonValue(this)->~CSSBasicShapePolygonValue(); |
401 return; | 401 return; |
402 case BasicShapeInsetClass: | 402 case BasicShapeInsetClass: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 return; | 503 return; |
504 case CustomPropertyDeclarationClass: | 504 case CustomPropertyDeclarationClass: |
505 toCSSCustomPropertyDeclaration(this)->~CSSCustomPropertyDeclaration(); | 505 toCSSCustomPropertyDeclaration(this)->~CSSCustomPropertyDeclaration(); |
506 return; | 506 return; |
507 } | 507 } |
508 ASSERT_NOT_REACHED(); | 508 ASSERT_NOT_REACHED(); |
509 } | 509 } |
510 | 510 |
511 DEFINE_TRACE(CSSValue) | 511 DEFINE_TRACE(CSSValue) |
512 { | 512 { |
513 switch (classType()) { | 513 switch (getClassType()) { |
514 case BasicShapeCircleClass: | 514 case BasicShapeCircleClass: |
515 toCSSBasicShapeCircleValue(this)->traceAfterDispatch(visitor); | 515 toCSSBasicShapeCircleValue(this)->traceAfterDispatch(visitor); |
516 return; | 516 return; |
517 case BasicShapeEllipseClass: | 517 case BasicShapeEllipseClass: |
518 toCSSBasicShapeEllipseValue(this)->traceAfterDispatch(visitor); | 518 toCSSBasicShapeEllipseValue(this)->traceAfterDispatch(visitor); |
519 return; | 519 return; |
520 case BasicShapePolygonClass: | 520 case BasicShapePolygonClass: |
521 toCSSBasicShapePolygonValue(this)->traceAfterDispatch(visitor); | 521 toCSSBasicShapePolygonValue(this)->traceAfterDispatch(visitor); |
522 return; | 522 return; |
523 case BasicShapeInsetClass: | 523 case BasicShapeInsetClass: |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 toCSSVariableReferenceValue(this)->traceAfterDispatch(visitor); | 623 toCSSVariableReferenceValue(this)->traceAfterDispatch(visitor); |
624 return; | 624 return; |
625 case CustomPropertyDeclarationClass: | 625 case CustomPropertyDeclarationClass: |
626 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor); | 626 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor); |
627 return; | 627 return; |
628 } | 628 } |
629 ASSERT_NOT_REACHED(); | 629 ASSERT_NOT_REACHED(); |
630 } | 630 } |
631 | 631 |
632 } // namespace blink | 632 } // namespace blink |
OLD | NEW |