Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: Source/core/css/CSSValue.cpp

Issue 27183005: Use DEFINE_CSS_VALUE_TYPE_CASTS() for SVGColor, SVGPaint, and TextCloneCSSValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSValue.h ('k') | Source/core/svg/SVGColor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValue.cpp
diff --git a/Source/core/css/CSSValue.cpp b/Source/core/css/CSSValue.cpp
index c1bdea3b4f0cca69c139b4e54e54ed009c105017..c0a05115a229baaa0dd67d9d82981a977519703c 100644
--- a/Source/core/css/CSSValue.cpp
+++ b/Source/core/css/CSSValue.cpp
@@ -85,6 +85,8 @@ private:
String m_cssText;
};
+DEFINE_CSS_VALUE_TYPE_CASTS(TextCloneCSSValue, isTextCloneCSSValue());
+
bool CSSValue::isImplicitInitialValue() const
{
return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit();
@@ -147,7 +149,7 @@ bool CSSValue::equals(const CSSValue& other) const
{
if (m_isTextClone) {
ASSERT(isCSSOMSafe());
- return static_cast<const TextCloneCSSValue*>(this)->cssText() == other.cssText();
+ return toTextCloneCSSValue(this)->cssText() == other.cssText();
}
if (m_classType == other.m_classType) {
@@ -235,7 +237,7 @@ String CSSValue::cssText() const
{
if (m_isTextClone) {
ASSERT(isCSSOMSafe());
- return static_cast<const TextCloneCSSValue*>(this)->cssText();
+ return toTextCloneCSSValue(this)->cssText();
}
ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM());
@@ -333,7 +335,7 @@ void CSSValue::destroy()
{
if (m_isTextClone) {
ASSERT(isCSSOMSafe());
- delete static_cast<TextCloneCSSValue*>(this);
+ delete toTextCloneCSSValue(this);
return;
}
ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM());
« no previous file with comments | « Source/core/css/CSSValue.h ('k') | Source/core/svg/SVGColor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698