Generate toCSSFooValue() for CSSCanvasValue

https://bugs.webkit.org/show_bug.cgi?id=122058

Reviewed by Antti Koivisto.

Generate toCSSFooValue() for CSSCanvasValue, and use it.
This type cast function will help to detect bad-casts.
isCanvasValue() is added in order to generate toCSSCanvasValue.

No new tests, no behavior change.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7010becb
2013-09-29 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Generate toCSSFooValue() for CSSCanvasValue
https://bugs.webkit.org/show_bug.cgi?id=122058
Reviewed by Antti Koivisto.
Generate toCSSFooValue() for CSSCanvasValue, and use it.
This type cast function will help to detect bad-casts.
isCanvasValue() is added in order to generate toCSSCanvasValue.
No new tests, no behavior change.
* css/CSSCanvasValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSValue.cpp:
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCanvasValue):
2013-09-29 Mark Rowe <mrowe@apple.com>
Fix the Lion build.
......@@ -94,6 +94,8 @@ private:
HTMLCanvasElement* m_element;
};
CSS_VALUE_TYPE_CASTS(CanvasValue)
} // namespace WebCore
#endif // CSSCanvasValue_h
......@@ -108,7 +108,7 @@ PassRefPtr<Image> CSSImageGeneratorValue::image(RenderElement* renderer, const I
{
switch (classType()) {
case CanvasClass:
return static_cast<CSSCanvasValue*>(this)->image(renderer, size);
return toCSSCanvasValue(this)->image(renderer, size);
case CrossfadeClass:
return toCSSCrossfadeValue(this)->image(renderer, size);
#if ENABLE(CSS_FILTERS)
......@@ -150,7 +150,7 @@ IntSize CSSImageGeneratorValue::fixedSize(const RenderElement* renderer)
{
switch (classType()) {
case CanvasClass:
return static_cast<CSSCanvasValue*>(this)->fixedSize(renderer);
return toCSSCanvasValue(this)->fixedSize(renderer);
case CrossfadeClass:
return toCSSCrossfadeValue(this)->fixedSize(renderer);
#if ENABLE(CSS_FILTERS)
......@@ -216,7 +216,7 @@ void CSSImageGeneratorValue::loadSubimages(CachedResourceLoader* cachedResourceL
toCSSCrossfadeValue(this)->loadSubimages(cachedResourceLoader);
break;
case CanvasClass:
static_cast<CSSCanvasValue*>(this)->loadSubimages(cachedResourceLoader);
toCSSCanvasValue(this)->loadSubimages(cachedResourceLoader);
break;
#if ENABLE(CSS_FILTERS)
case FilterImageClass:
......
......@@ -389,7 +389,7 @@ void CSSValue::destroy()
delete static_cast<CSSBorderImageSliceValue*>(this);
return;
case CanvasClass:
delete static_cast<CSSCanvasValue*>(this);
delete toCSSCanvasValue(this);
return;
case CursorImageClass:
delete static_cast<CSSCursorImageValue*>(this);
......
......@@ -71,6 +71,7 @@ public:
bool isAspectRatioValue() const { return m_classType == AspectRatioClass; }
bool isBorderImageSliceValue() const { return m_classType == BorderImageSliceClass; }
bool isCanvasValue() const { return m_classType == CanvasClass; }
bool isCrossfadeValue() const { return m_classType == CrossfadeClass; }
bool isCursorImageValue() const { return m_classType == CursorImageClass; }
bool isFontFeatureValue() const { return m_classType == FontFeatureClass; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment