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
bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSValue& value)
{
switch (value.cssValueType()) {
case CSSValue::CSS_INHERIT:
// FIXME: should not require resolving styles for initial.
if (value.isInitialValue() || value.isInheritedValue())
return true;
case CSSValue::CSS_PRIMITIVE_VALUE:
if (value.isPrimitiveValue())
return interpolationRequiresStyleResolve(toCSSPrimitiveValue(value));
case CSSValue::CSS_VALUE_LIST:
if (value.isValueList())
return interpolationRequiresStyleResolve(toCSSValueList(value));
case CSSValue::CSS_CUSTOM:
if (value.isImageValue())
return interpolationRequiresStyleResolve(toCSSImageValue(value));
if (value.isShadowValue())
return interpolationRequiresStyleResolve(toCSSShadowValue(value));
if (value.isSVGDocumentValue())
return interpolationRequiresStyleResolve(toCSSSVGDocumentValue(value));
// FIXME: consider other custom types.
return true;
case CSSValue::CSS_INITIAL:
// FIXME: should not require resolving styles for initial.
return true;
default:
ASSERT_NOT_REACHED();
return true;
}
if (value.isImageValue())
return interpolationRequiresStyleResolve(toCSSImageValue(value));
if (value.isShadowValue())
return interpolationRequiresStyleResolve(toCSSShadowValue(value));
if (value.isSVGDocumentValue())
return interpolationRequiresStyleResolve(toCSSSVGDocumentValue(value));
// FIXME: consider other custom types.
return true;
}
bool DeferredLegacyStyleInterpolation::interpolationRequiresStyleResolve(const CSSPrimitiveValue& primitiveValue)
......
......@@ -69,19 +69,6 @@ bool CSSValue::isImplicitInitialValue() const
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
{
if (isValueList())
......
......@@ -34,14 +34,6 @@ enum CSSTextFormattingFlags { QuoteCSSStringIfNeeded, AlwaysQuoteCSSString };
class CSSValue : public RefCountedWillBeGarbageCollectedFinalized<CSSValue> {
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
// the appropriate subclass type.
// When oilpan is enabled the finalize method is called by the garbage
......@@ -54,8 +46,6 @@ public:
}
#endif // !ENABLE(OILPAN)
Type cssValueType() const;
String cssText() const;
bool isPrimitiveValue() const { return m_classType == PrimitiveClass; }
......
......@@ -886,26 +886,24 @@ String StylePropertySerializer::backgroundRepeatPropertyValue() const
return String();
if (m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatX) != m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatY))
return String();
if (repeatX->cssValueType() == repeatY->cssValueType()
&& (repeatX->cssValueType() == CSSValue::CSS_INITIAL || repeatX->cssValueType() == CSSValue::CSS_INHERIT)) {
if ((repeatX->isInitialValue() && repeatY->isInitialValue()) || (repeatX->isInheritedValue() && repeatY->isInheritedValue()))
return repeatX->cssText();
}
const CSSValueList* repeatXList = 0;
int repeatXLength = 1;
if (repeatX->cssValueType() == CSSValue::CSS_VALUE_LIST) {
if (repeatX->isValueList()) {
repeatXList = toCSSValueList(repeatX);
repeatXLength = repeatXList->length();
} else if (repeatX->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) {
} else if (!repeatX->isPrimitiveValue()) {
return String();
}
const CSSValueList* repeatYList = 0;
int repeatYLength = 1;
if (repeatY->cssValueType() == CSSValue::CSS_VALUE_LIST) {
if (repeatY->isValueList()) {
repeatYList = toCSSValueList(repeatY);
repeatYLength = repeatYList->length();
} else if (repeatY->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) {
} else if (!repeatY->isPrimitiveValue()) {
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