Generate toCSSCalcValue instead of using manual cast function
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 10:39:08 +0000 (10:39 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 10:39:08 +0000 (10:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122055

Reviewed by Antti Koivisto.

Generated type cast function supports more plenty functions rather than manual functions.
To use CSS_VALUE_TYPE_CAST, isCalculationValue() needs to be changed with isCalcValue().

No new tests, no behavior changes.

* css/CSSCalculationValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCalcValue):
* css/StyleResolver.cpp:
(WebCore::hasVariableReference):

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

Source/WebCore/ChangeLog
Source/WebCore/css/CSSCalculationValue.h
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/StyleResolver.cpp

index 26e3c35..0098a00 100644 (file)
@@ -1,3 +1,23 @@
+2013-09-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Generate toCSSCalcValue instead of using manual cast function
+        https://bugs.webkit.org/show_bug.cgi?id=122055
+
+        Reviewed by Antti Koivisto.
+
+        Generated type cast function supports more plenty functions rather than manual functions.
+        To use CSS_VALUE_TYPE_CAST, isCalculationValue() needs to be changed with isCalcValue().
+
+        No new tests, no behavior changes.
+
+        * css/CSSCalculationValue.h:
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::destroy):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isCalcValue):
+        * css/StyleResolver.cpp:
+        (WebCore::hasVariableReference):
+
 2013-09-30  Antti Koivisto  <antti@apple.com>
 
         Get rid of static map for marking ancestor line boxes dirty
index e7db0ce..1009b5f 100644 (file)
@@ -145,17 +145,7 @@ private:
     const bool m_nonNegative;
 };
 
-inline CSSCalcValue* toCSSCalcValue(CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isCalculationValue());
-    return static_cast<CSSCalcValue*>(value);
-}
-
-inline const CSSCalcValue* toCSSCalcValue(const CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isCalculationValue());
-    return static_cast<const CSSCalcValue*>(value);
-}
+CSS_VALUE_TYPE_CASTS(CalcValue)
 
 } // namespace WebCore
 
index e0188c3..2049538 100644 (file)
@@ -452,7 +452,7 @@ void CSSValue::destroy()
         delete toCSSLineBoxContainValue(this);
         return;
     case CalculationClass:
-        delete static_cast<CSSCalcValue*>(this);
+        delete toCSSCalcValue(this);
         return;
 #if ENABLE(CSS_IMAGE_SET)
     case ImageSetClass:
index be077f4..6845a7f 100644 (file)
@@ -93,7 +93,7 @@ public:
     bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingFunctionClass; }
     bool isWebKitCSSTransformValue() const { return m_classType == WebKitCSSTransformClass; }
     bool isLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
-    bool isCalculationValue() const {return m_classType == CalculationClass; }
+    bool isCalcValue() const {return m_classType == CalculationClass; }
 #if ENABLE(CSS_FILTERS)
     bool isFilterImageValue() const { return m_classType == FilterImageClass; }
     bool isWebKitCSSFilterValue() const { return m_classType == WebKitCSSFilterClass; }
index ca22354..375d8c1 100644 (file)
@@ -2039,8 +2039,8 @@ static bool hasVariableReference(CSSValue* value)
         return primitiveValue->hasVariableReference();
     }
 
-    if (value->isCalculationValue())
-        return static_cast<CSSCalcValue*>(value)->hasVariableReference();
+    if (value->isCalcValue())
+        return toCSSCalcValue(value)->hasVariableReference();
 
     if (value->isReflectValue()) {
         CSSReflectValue* reflectValue = toCSSReflectValue(value);