Generate toCSSFooValue() for CSSLineBoxContainValue
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 05:28:58 +0000 (05:28 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 05:28:58 +0000 (05:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122054

Reviewed by Darin Adler.

As a step to use toCSSFooValue, toCSSLineBoxContainValue is generated by using
CSS_VALUE_TYPE_CASTS. To use it, isCSSLineBoxContainValue() is changed to
isLineBoxContatinValue(). Unnecessary local variable is removed by this patch.

No new tests, no behavior changes.

* css/CSSLineBoxContainValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isLineBoxContainValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):

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

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

index 4990432..b6ddb2a 100644 (file)
@@ -1,5 +1,26 @@
 2013-09-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
+        Generate toCSSFooValue() for CSSLineBoxContainValue
+        https://bugs.webkit.org/show_bug.cgi?id=122054
+
+        Reviewed by Darin Adler.
+
+        As a step to use toCSSFooValue, toCSSLineBoxContainValue is generated by using
+        CSS_VALUE_TYPE_CASTS. To use it, isCSSLineBoxContainValue() is changed to
+        isLineBoxContatinValue(). Unnecessary local variable is removed by this patch.
+
+        No new tests, no behavior changes.
+
+        * css/CSSLineBoxContainValue.h:
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::destroy):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isLineBoxContainValue):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+
+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
 
index a3c9298..13e88d8 100644 (file)
@@ -57,6 +57,8 @@ private:
     CSSLineBoxContainValue(LineBoxContain);
 };
 
+CSS_VALUE_TYPE_CASTS(LineBoxContainValue)
+
 } // namespace
 
 #endif
index c2f30e5..9073ef8 100644 (file)
@@ -449,7 +449,7 @@ void CSSValue::destroy()
         delete toWebKitCSSTransformValue(this);
         return;
     case LineBoxContainClass:
-        delete static_cast<CSSLineBoxContainValue*>(this);
+        delete toCSSLineBoxContainValue(this);
         return;
     case CalculationClass:
         delete static_cast<CSSCalcValue*>(this);
index 506e25d..00af645 100644 (file)
@@ -89,7 +89,7 @@ public:
     bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicBezierTimingFunctionClass; }
     bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingFunctionClass; }
     bool isWebKitCSSTransformValue() const { return m_classType == WebKitCSSTransformClass; }
-    bool isCSSLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
+    bool isLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
     bool isCalculationValue() const {return m_classType == CalculationClass; }
 #if ENABLE(CSS_FILTERS)
     bool isFilterImageValue() const { return m_classType == FilterImageClass; }
index 6f95d81..75aa988 100644 (file)
@@ -2694,11 +2694,10 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
             return;
         }
 
-        if (!value->isCSSLineBoxContainValue())
+        if (!value->isLineBoxContainValue())
             return;
 
-        CSSLineBoxContainValue* lineBoxContainValue = static_cast<CSSLineBoxContainValue*>(value);
-        state.style()->setLineBoxContain(lineBoxContainValue->value());
+        state.style()->setLineBoxContain(toCSSLineBoxContainValue(value)->value());
         return;
     }