| 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 * | 24 * |
| 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/CSSCalculationValue.h" | 31 #include "core/css/CSSCalculationValue.h" |
| 32 #include "core/css/CSSCanvasValue.h" | 32 #include "core/css/CSSCanvasValue.h" |
| 33 #include "core/css/CSSContentDistributionValue.h" |
| 33 #include "core/css/CSSCrossfadeValue.h" | 34 #include "core/css/CSSCrossfadeValue.h" |
| 34 #include "core/css/CSSCursorImageValue.h" | 35 #include "core/css/CSSCursorImageValue.h" |
| 35 #include "core/css/CSSFilterValue.h" | 36 #include "core/css/CSSFilterValue.h" |
| 36 #include "core/css/CSSFontFaceSrcValue.h" | 37 #include "core/css/CSSFontFaceSrcValue.h" |
| 37 #include "core/css/CSSFontFeatureValue.h" | 38 #include "core/css/CSSFontFeatureValue.h" |
| 38 #include "core/css/CSSFontValue.h" | 39 #include "core/css/CSSFontValue.h" |
| 39 #include "core/css/CSSFunctionValue.h" | 40 #include "core/css/CSSFunctionValue.h" |
| 40 #include "core/css/CSSGradientValue.h" | 41 #include "core/css/CSSGradientValue.h" |
| 41 #include "core/css/CSSGridLineNamesValue.h" | 42 #include "core/css/CSSGridLineNamesValue.h" |
| 42 #include "core/css/CSSGridTemplateAreasValue.h" | 43 #include "core/css/CSSGridTemplateAreasValue.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 case LineBoxContainClass: | 203 case LineBoxContainClass: |
| 203 return compareCSSValues<CSSLineBoxContainValue>(*this, other); | 204 return compareCSSValues<CSSLineBoxContainValue>(*this, other); |
| 204 case CalculationClass: | 205 case CalculationClass: |
| 205 return compareCSSValues<CSSCalcValue>(*this, other); | 206 return compareCSSValues<CSSCalcValue>(*this, other); |
| 206 case ImageSetClass: | 207 case ImageSetClass: |
| 207 return compareCSSValues<CSSImageSetValue>(*this, other); | 208 return compareCSSValues<CSSImageSetValue>(*this, other); |
| 208 case CSSFilterClass: | 209 case CSSFilterClass: |
| 209 return compareCSSValues<CSSFilterValue>(*this, other); | 210 return compareCSSValues<CSSFilterValue>(*this, other); |
| 210 case CSSSVGDocumentClass: | 211 case CSSSVGDocumentClass: |
| 211 return compareCSSValues<CSSSVGDocumentValue>(*this, other); | 212 return compareCSSValues<CSSSVGDocumentValue>(*this, other); |
| 213 case CSSContentDistributionClass: |
| 214 return compareCSSValues<CSSContentDistributionValue>(*this, other); |
| 212 default: | 215 default: |
| 213 ASSERT_NOT_REACHED(); | 216 ASSERT_NOT_REACHED(); |
| 214 return false; | 217 return false; |
| 215 } | 218 } |
| 216 } else if (m_classType == ValueListClass && other.m_classType != ValueListCl
ass) | 219 } else if (m_classType == ValueListClass && other.m_classType != ValueListCl
ass) |
| 217 return toCSSValueList(this)->equals(other); | 220 return toCSSValueList(this)->equals(other); |
| 218 else if (m_classType != ValueListClass && other.m_classType == ValueListClas
s) | 221 else if (m_classType != ValueListClass && other.m_classType == ValueListClas
s) |
| 219 return static_cast<const CSSValueList&>(other).equals(*this); | 222 return static_cast<const CSSValueList&>(other).equals(*this); |
| 220 return false; | 223 return false; |
| 221 } | 224 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 case LineBoxContainClass: | 281 case LineBoxContainClass: |
| 279 return toCSSLineBoxContainValue(this)->customCSSText(); | 282 return toCSSLineBoxContainValue(this)->customCSSText(); |
| 280 case CalculationClass: | 283 case CalculationClass: |
| 281 return toCSSCalcValue(this)->customCSSText(); | 284 return toCSSCalcValue(this)->customCSSText(); |
| 282 case ImageSetClass: | 285 case ImageSetClass: |
| 283 return toCSSImageSetValue(this)->customCSSText(); | 286 return toCSSImageSetValue(this)->customCSSText(); |
| 284 case CSSFilterClass: | 287 case CSSFilterClass: |
| 285 return toCSSFilterValue(this)->customCSSText(); | 288 return toCSSFilterValue(this)->customCSSText(); |
| 286 case CSSSVGDocumentClass: | 289 case CSSSVGDocumentClass: |
| 287 return toCSSSVGDocumentValue(this)->customCSSText(); | 290 return toCSSSVGDocumentValue(this)->customCSSText(); |
| 291 case CSSContentDistributionClass: |
| 292 return toCSSContentDistributionValue(this)->customCSSText(); |
| 288 } | 293 } |
| 289 ASSERT_NOT_REACHED(); | 294 ASSERT_NOT_REACHED(); |
| 290 return String(); | 295 return String(); |
| 291 } | 296 } |
| 292 | 297 |
| 293 void CSSValue::destroy() | 298 void CSSValue::destroy() |
| 294 { | 299 { |
| 295 if (m_isTextClone) { | 300 if (m_isTextClone) { |
| 296 ASSERT(isCSSOMSafe()); | 301 ASSERT(isCSSOMSafe()); |
| 297 delete toTextCloneCSSValue(this); | 302 delete toTextCloneCSSValue(this); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 return; | 382 return; |
| 378 case ImageSetClass: | 383 case ImageSetClass: |
| 379 delete toCSSImageSetValue(this); | 384 delete toCSSImageSetValue(this); |
| 380 return; | 385 return; |
| 381 case CSSFilterClass: | 386 case CSSFilterClass: |
| 382 delete toCSSFilterValue(this); | 387 delete toCSSFilterValue(this); |
| 383 return; | 388 return; |
| 384 case CSSSVGDocumentClass: | 389 case CSSSVGDocumentClass: |
| 385 delete toCSSSVGDocumentValue(this); | 390 delete toCSSSVGDocumentValue(this); |
| 386 return; | 391 return; |
| 392 case CSSContentDistributionClass: |
| 393 delete toCSSContentDistributionValue(this); |
| 394 return; |
| 387 } | 395 } |
| 388 ASSERT_NOT_REACHED(); | 396 ASSERT_NOT_REACHED(); |
| 389 } | 397 } |
| 390 | 398 |
| 391 void CSSValue::finalizeGarbageCollectedObject() | 399 void CSSValue::finalizeGarbageCollectedObject() |
| 392 { | 400 { |
| 393 if (m_isTextClone) { | 401 if (m_isTextClone) { |
| 394 ASSERT(isCSSOMSafe()); | 402 ASSERT(isCSSOMSafe()); |
| 395 toTextCloneCSSValue(this)->~TextCloneCSSValue(); | 403 toTextCloneCSSValue(this)->~TextCloneCSSValue(); |
| 396 return; | 404 return; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 return; | 483 return; |
| 476 case ImageSetClass: | 484 case ImageSetClass: |
| 477 toCSSImageSetValue(this)->~CSSImageSetValue(); | 485 toCSSImageSetValue(this)->~CSSImageSetValue(); |
| 478 return; | 486 return; |
| 479 case CSSFilterClass: | 487 case CSSFilterClass: |
| 480 toCSSFilterValue(this)->~CSSFilterValue(); | 488 toCSSFilterValue(this)->~CSSFilterValue(); |
| 481 return; | 489 return; |
| 482 case CSSSVGDocumentClass: | 490 case CSSSVGDocumentClass: |
| 483 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); | 491 toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue(); |
| 484 return; | 492 return; |
| 493 case CSSContentDistributionClass: |
| 494 toCSSContentDistributionValue(this)->~CSSContentDistributionValue(); |
| 495 return; |
| 485 } | 496 } |
| 486 ASSERT_NOT_REACHED(); | 497 ASSERT_NOT_REACHED(); |
| 487 } | 498 } |
| 488 | 499 |
| 489 void CSSValue::trace(Visitor* visitor) | 500 void CSSValue::trace(Visitor* visitor) |
| 490 { | 501 { |
| 491 if (m_isTextClone) { | 502 if (m_isTextClone) { |
| 492 ASSERT(isCSSOMSafe()); | 503 ASSERT(isCSSOMSafe()); |
| 493 toTextCloneCSSValue(this)->traceAfterDispatch(visitor); | 504 toTextCloneCSSValue(this)->traceAfterDispatch(visitor); |
| 494 return; | 505 return; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 return; | 584 return; |
| 574 case ImageSetClass: | 585 case ImageSetClass: |
| 575 toCSSImageSetValue(this)->traceAfterDispatch(visitor); | 586 toCSSImageSetValue(this)->traceAfterDispatch(visitor); |
| 576 return; | 587 return; |
| 577 case CSSFilterClass: | 588 case CSSFilterClass: |
| 578 toCSSFilterValue(this)->traceAfterDispatch(visitor); | 589 toCSSFilterValue(this)->traceAfterDispatch(visitor); |
| 579 return; | 590 return; |
| 580 case CSSSVGDocumentClass: | 591 case CSSSVGDocumentClass: |
| 581 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); | 592 toCSSSVGDocumentValue(this)->traceAfterDispatch(visitor); |
| 582 return; | 593 return; |
| 594 case CSSContentDistributionClass: |
| 595 toCSSContentDistributionValue(this)->traceAfterDispatch(visitor); |
| 596 return; |
| 583 } | 597 } |
| 584 ASSERT_NOT_REACHED(); | 598 ASSERT_NOT_REACHED(); |
| 585 } | 599 } |
| 586 | 600 |
| 587 PassRefPtrWillBeRawPtr<CSSValue> CSSValue::cloneForCSSOM() const | 601 PassRefPtrWillBeRawPtr<CSSValue> CSSValue::cloneForCSSOM() const |
| 588 { | 602 { |
| 589 switch (classType()) { | 603 switch (classType()) { |
| 590 case PrimitiveClass: | 604 case PrimitiveClass: |
| 591 return toCSSPrimitiveValue(this)->cloneForCSSOM(); | 605 return toCSSPrimitiveValue(this)->cloneForCSSOM(); |
| 592 case ValueListClass: | 606 case ValueListClass: |
| 593 return toCSSValueList(this)->cloneForCSSOM(); | 607 return toCSSValueList(this)->cloneForCSSOM(); |
| 594 case ImageClass: | 608 case ImageClass: |
| 595 case CursorImageClass: | 609 case CursorImageClass: |
| 596 return toCSSImageValue(this)->cloneForCSSOM(); | 610 return toCSSImageValue(this)->cloneForCSSOM(); |
| 597 case CSSFilterClass: | 611 case CSSFilterClass: |
| 598 return toCSSFilterValue(this)->cloneForCSSOM(); | 612 return toCSSFilterValue(this)->cloneForCSSOM(); |
| 599 case CSSTransformClass: | 613 case CSSTransformClass: |
| 600 return toCSSTransformValue(this)->cloneForCSSOM(); | 614 return toCSSTransformValue(this)->cloneForCSSOM(); |
| 601 case ImageSetClass: | 615 case ImageSetClass: |
| 602 return toCSSImageSetValue(this)->cloneForCSSOM(); | 616 return toCSSImageSetValue(this)->cloneForCSSOM(); |
| 603 default: | 617 default: |
| 604 ASSERT(!isSubtypeExposedToCSSOM()); | 618 ASSERT(!isSubtypeExposedToCSSOM()); |
| 605 return TextCloneCSSValue::create(classType(), cssText()); | 619 return TextCloneCSSValue::create(classType(), cssText()); |
| 606 } | 620 } |
| 607 } | 621 } |
| 608 | 622 |
| 609 } | 623 } |
| OLD | NEW |