Generate toCSSCrossfadeValue() instead of using manual function
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 05:26:17 +0000 (05:26 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 05:26:17 +0000 (05:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122057

Reviewed by Antti Koivisto.

Generated toCSSFooValue() supports more plenty functions rather than
to use manual cast function.

No new tests, no behavior changes.

* css/CSSCrossfadeValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSValue.cpp:
(WebCore::CSSValue::destroy):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSCrossfadeValue.h
Source/WebCore/css/CSSImageGeneratorValue.cpp
Source/WebCore/css/CSSValue.cpp

index 23993f8..4990432 100644 (file)
@@ -1,5 +1,25 @@
 2013-09-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
 2013-09-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
+        Generate toCSSCrossfadeValue() instead of using manual function
+        https://bugs.webkit.org/show_bug.cgi?id=122057
+
+        Reviewed by Antti Koivisto.
+
+        Generated toCSSFooValue() supports more plenty functions rather than
+        to use manual cast function.
+
+        No new tests, no behavior changes.
+
+        * css/CSSCrossfadeValue.h:
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::image):
+        (WebCore::CSSImageGeneratorValue::fixedSize):
+        (WebCore::CSSImageGeneratorValue::loadSubimages):
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::destroy):
+
+2013-09-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
         Generate toCSSFooValue() for CSSFilterImageValue and CSSInitialValue
         https://bugs.webkit.org/show_bug.cgi?id=122056
 
         Generate toCSSFooValue() for CSSFilterImageValue and CSSInitialValue
         https://bugs.webkit.org/show_bug.cgi?id=122056
 
index 964b116..4cf5c8a 100644 (file)
@@ -110,11 +110,7 @@ private:
     CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver;
 };
 
     CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver;
 };
 
-inline CSSCrossfadeValue* toCSSCrossfadeValue(CSSImageGeneratorValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isCrossfadeValue());
-    return static_cast<CSSCrossfadeValue*>(value);
-}
+CSS_VALUE_TYPE_CASTS(CrossfadeValue)
 
 } // namespace WebCore
 
 
 } // namespace WebCore
 
index 274472b..aa1950f 100644 (file)
@@ -110,7 +110,7 @@ PassRefPtr<Image> CSSImageGeneratorValue::image(RenderElement* renderer, const I
     case CanvasClass:
         return static_cast<CSSCanvasValue*>(this)->image(renderer, size);
     case CrossfadeClass:
     case CanvasClass:
         return static_cast<CSSCanvasValue*>(this)->image(renderer, size);
     case CrossfadeClass:
-        return static_cast<CSSCrossfadeValue*>(this)->image(renderer, size);
+        return toCSSCrossfadeValue(this)->image(renderer, size);
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
         return toCSSFilterImageValue(this)->image(renderer, size);
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
         return toCSSFilterImageValue(this)->image(renderer, size);
@@ -152,7 +152,7 @@ IntSize CSSImageGeneratorValue::fixedSize(const RenderElement* renderer)
     case CanvasClass:
         return static_cast<CSSCanvasValue*>(this)->fixedSize(renderer);
     case CrossfadeClass:
     case CanvasClass:
         return static_cast<CSSCanvasValue*>(this)->fixedSize(renderer);
     case CrossfadeClass:
-        return static_cast<CSSCrossfadeValue*>(this)->fixedSize(renderer);
+        return toCSSCrossfadeValue(this)->fixedSize(renderer);
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
         return toCSSFilterImageValue(this)->fixedSize(renderer);
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
         return toCSSFilterImageValue(this)->fixedSize(renderer);
@@ -213,7 +213,7 @@ void CSSImageGeneratorValue::loadSubimages(CachedResourceLoader* cachedResourceL
 {
     switch (classType()) {
     case CrossfadeClass:
 {
     switch (classType()) {
     case CrossfadeClass:
-        static_cast<CSSCrossfadeValue*>(this)->loadSubimages(cachedResourceLoader);
+        toCSSCrossfadeValue(this)->loadSubimages(cachedResourceLoader);
         break;
     case CanvasClass:
         static_cast<CSSCanvasValue*>(this)->loadSubimages(cachedResourceLoader);
         break;
     case CanvasClass:
         static_cast<CSSCanvasValue*>(this)->loadSubimages(cachedResourceLoader);
index 3aefdde..c2f30e5 100644 (file)
@@ -413,7 +413,7 @@ void CSSValue::destroy()
         delete static_cast<CSSRadialGradientValue*>(this);
         return;
     case CrossfadeClass:
         delete static_cast<CSSRadialGradientValue*>(this);
         return;
     case CrossfadeClass:
-        delete static_cast<CSSCrossfadeValue*>(this);
+        delete toCSSCrossfadeValue(this);
         return;
     case ImageClass:
         delete toCSSImageValue(this);
         return;
     case ImageClass:
         delete toCSSImageValue(this);