This source file includes following definitions.
- m_type
- customCSSText
- m_type
- cloneForCSSOM
- equals
#include "config.h"
#include "core/css/CSSFilterValue.h"
#include "wtf/text/StringBuilder.h"
namespace WebCore {
CSSFilterValue::CSSFilterValue(FilterOperationType operationType)
: CSSValueList(CSSFilterClass, CommaSeparator)
, m_type(operationType)
{
}
String CSSFilterValue::customCSSText() const
{
StringBuilder result;
switch (m_type) {
case ReferenceFilterOperation:
result.append("url(");
break;
case GrayscaleFilterOperation:
result.append("grayscale(");
break;
case SepiaFilterOperation:
result.append("sepia(");
break;
case SaturateFilterOperation:
result.append("saturate(");
break;
case HueRotateFilterOperation:
result.append("hue-rotate(");
break;
case InvertFilterOperation:
result.append("invert(");
break;
case OpacityFilterOperation:
result.append("opacity(");
break;
case BrightnessFilterOperation:
result.append("brightness(");
break;
case ContrastFilterOperation:
result.append("contrast(");
break;
case BlurFilterOperation:
result.append("blur(");
break;
case DropShadowFilterOperation:
result.append("drop-shadow(");
break;
default:
break;
}
result.append(CSSValueList::customCSSText());
result.append(')');
return result.toString();
}
CSSFilterValue::CSSFilterValue(const CSSFilterValue& cloneFrom)
: CSSValueList(cloneFrom)
, m_type(cloneFrom.m_type)
{
}
PassRefPtrWillBeRawPtr<CSSFilterValue> CSSFilterValue::cloneForCSSOM() const
{
return adoptRefWillBeRefCountedGarbageCollected(new CSSFilterValue(*this));
}
bool CSSFilterValue::equals(const CSSFilterValue& other) const
{
return m_type == other.m_type && CSSValueList::equals(other);
}
}