This source file includes following definitions.
- transformValueToCssString
- m_type
- customCSSText
- m_type
- cloneForCSSOM
#include "config.h"
#include "core/css/CSSTransformValue.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
const char* const transformNamePrefixes[] = {
0,
"translate(",
"translateX(",
"translateY(",
"rotate(",
"scale(",
"scaleX(",
"scaleY(",
"skew(",
"skewX(",
"skewY(",
"matrix(",
"translateZ(",
"translate3d(",
"rotateX(",
"rotateY(",
"rotateZ(",
"rotate3d(",
"scaleZ(",
"scale3d(",
"perspective(",
"matrix3d("
};
static inline String transformValueToCssString(CSSTransformValue::TransformOperationType operation, const String& value)
{
if (operation != CSSTransformValue::UnknownTransformOperation) {
ASSERT_WITH_SECURITY_IMPLICATION(static_cast<size_t>(operation) < WTF_ARRAY_LENGTH(transformNamePrefixes));
return transformNamePrefixes[operation] + value + ")";
}
return String();
}
CSSTransformValue::CSSTransformValue(TransformOperationType op)
: CSSValueList(CSSTransformClass, CommaSeparator)
, m_type(op)
{
}
String CSSTransformValue::customCSSText() const
{
return transformValueToCssString(m_type, CSSValueList::customCSSText());
}
CSSTransformValue::CSSTransformValue(const CSSTransformValue& cloneFrom)
: CSSValueList(cloneFrom)
, m_type(cloneFrom.m_type)
{
}
PassRefPtrWillBeRawPtr<CSSTransformValue> CSSTransformValue::cloneForCSSOM() const
{
return adoptRefWillBeRefCountedGarbageCollected(new CSSTransformValue(*this));
}
}