Commit 75f1c3cd authored by timloh@chromium.org's avatar timloh@chromium.org

Remove CSSValue::Type and CSSValue::cssValueType()

This interface isn't particularly useful and since we no longer expose
it to the web we don't need to keep it around.

Review URL: https://codereview.chromium.org/719993002

git-svn-id: svn://svn.chromium.org/blink/trunk@185253 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 945ec6c9
...@@ -30,29 +30,21 @@ void DeferredLegacyStyleInterpolation::apply(StyleResolverState& state) const ...@@ -30,29 +30,21 @@ void DeferredLegacyStyleInterpolation::apply(StyleResolverState& state) const
bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSValue& value) bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSValue& value)
{ {
switch (value.cssValueType()) { // FIXME: should not require resolving styles for initial.
case CSSValue::CSS_INHERIT: if (value.isInitialValue() || value.isInheritedValue())
return true; return true;
case CSSValue::CSS_PRIMITIVE_VALUE: if (value.isPrimitiveValue())
return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value)); return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value));
case CSSValue::CSS_VALUE_LIST: if (value.isValueList())
return interpolationRequiresStyleResolve(toCSSValueList(value)); return interpolationRequiresStyleResolve(toCSSValueList(value));
case CSSValue::CSS_CUSTOM: if (value.isImageValue())
if (value.isImageValue()) return interpolationRequiresStyleResolve(toCSSImageValue(value));
return interpolationRequiresStyleResolve(toCSSImageValue(value)); if (value.isShadowValue())
if (value.isShadowValue()) return interpolationRequiresStyleResolve(toCSSShadowValue(value));
return interpolationRequiresStyleResolve(toCSSShadowValue(value)); if (value.isSVGDocumentValue())
if (value.isSVGDocumentValue()) return interpolationRequiresStyleResolve(toCSSSVGDocumentValue(value));
return interpolationRequiresStyleResolve(toCSSSVGDocumentValue(value)); // FIXME: consider other custom types.
// FIXME: consider other custom types. return true;
return true;
case CSSValue::CSS_INITIAL:
// FIXME: should not require resolving styles for initial.
return true;
default:
ASSERT_NOT_REACHED();
return true;
}
} }
bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSPrimitiveValue& primitiveValue) bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSPrimitiveValue& primitiveValue)
......
...@@ -69,19 +69,6 @@ bool CSSValue::isImplicitInitialValue() const ...@@ -69,19 +69,6 @@ bool CSSValue::isImplicitInitialValue() const
return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit(); return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit();
} }
CSSValue::Type CSSValue::cssValueType() const
{
if (isInheritedValue())
return CSS_INHERIT;
if (isPrimitiveValue())
return CSS_PRIMITIVE_VALUE;
if (isValueList())
return CSS_VALUE_LIST;
if (isInitialValue())
return CSS_INITIAL;
return CSS_CUSTOM;
}
bool CSSValue::hasFailedOrCanceledSubresources() const bool CSSValue::hasFailedOrCanceledSubresources() const
{ {
if (isValueList()) if (isValueList())
......
...@@ -34,14 +34,6 @@ enum CSSTextFormattingFlags { QuoteCSSStringIfNeeded, AlwaysQuoteCSSString }; ...@@ -34,14 +34,6 @@ enum CSSTextFormattingFlags { QuoteCSSStringIfNeeded, AlwaysQuoteCSSString };
class CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> { class CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> {
public: public:
enum Type {
CSS_INHERIT = 0,
CSS_PRIMITIVE_VALUE = 1,
CSS_VALUE_LIST = 2,
CSS_CUSTOM = 3,
CSS_INITIAL = 4
};
// Override RefCounted's deref() to ensure operator delete is called on // Override RefCounted's deref() to ensure operator delete is called on
// the appropriate subclass type. // the appropriate subclass type.
// When oilpan is enabled the finalize method is called by the garbage // When oilpan is enabled the finalize method is called by the garbage
...@@ -54,8 +46,6 @@ public: ...@@ -54,8 +46,6 @@ public:
} }
#endif // !ENABLE(OILPAN) #endif // !ENABLE(OILPAN)
Type cssValueType() const;
String cssText() const; String cssText() const;
bool isPrimitiveValue() const { return m_classType == PrimitiveClass; } bool isPrimitiveValue() const { return m_classType == PrimitiveClass; }
......
...@@ -886,26 +886,24 @@ String StylePropertySerializer::backgroundRepeatPropertyValue() const ...@@ -886,26 +886,24 @@ String StylePropertySerializer::backgroundRepeatPropertyValue() const
return String(); return String();
if (m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatX) != m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatY)) if (m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatX) != m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatY))
return String(); return String();
if (repeatX->cssValueType() == repeatY->cssValueType() if ((repeatX->isInitialValue() && repeatY->isInitialValue()) || (repeatX->isInheritedValue() && repeatY->isInheritedValue()))
&& (repeatX->cssValueType() == CSSValue::CSS_INITIAL || repeatX->cssValueType() == CSSValue::CSS_INHERIT)) {
return repeatX->cssText(); return repeatX->cssText();
}
const CSSValueList* repeatXList = 0; const CSSValueList* repeatXList = 0;
int repeatXLength = 1; int repeatXLength = 1;
if (repeatX->cssValueType() == CSSValue::CSS_VALUE_LIST) { if (repeatX->isValueList()) {
repeatXList = toCSSValueList(repeatX); repeatXList = toCSSValueList(repeatX);
repeatXLength = repeatXList->length(); repeatXLength = repeatXList->length();
} else if (repeatX->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) { } else if (!repeatX->isPrimitiveValue()) {
return String(); return String();
} }
const CSSValueList* repeatYList = 0; const CSSValueList* repeatYList = 0;
int repeatYLength = 1; int repeatYLength = 1;
if (repeatY->cssValueType() == CSSValue::CSS_VALUE_LIST) { if (repeatY->isValueList()) {
repeatYList = toCSSValueList(repeatY); repeatYList = toCSSValueList(repeatY);
repeatYLength = repeatYList->length(); repeatYLength = repeatYList->length();
} else if (repeatY->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) { } else if (!repeatY->isPrimitiveValue()) {
return String(); return String();
} }
......
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