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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d79d1b63
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
......@@ -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
......
......@@ -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:
......
......@@ -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; }
......
......@@ -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);
......
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