This source file includes following definitions.
- color
- customCSSText
- equals
- traceAfterDispatch
#include "config.h"
#include "core/css/CSSShadowValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
CSSShadowValue::CSSShadowValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> x,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue> y,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue> blur,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue> spread,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue> style,
PassRefPtrWillBeRawPtr<CSSPrimitiveValue> color)
: CSSValue(ShadowClass)
, x(x)
, y(y)
, blur(blur)
, spread(spread)
, style(style)
, color(color)
{
}
String CSSShadowValue::customCSSText() const
{
StringBuilder text;
if (color)
text.append(color->cssText());
if (x) {
if (!text.isEmpty())
text.append(' ');
text.append(x->cssText());
}
if (y) {
if (!text.isEmpty())
text.append(' ');
text.append(y->cssText());
}
if (blur) {
if (!text.isEmpty())
text.append(' ');
text.append(blur->cssText());
}
if (spread) {
if (!text.isEmpty())
text.append(' ');
text.append(spread->cssText());
}
if (style) {
if (!text.isEmpty())
text.append(' ');
text.append(style->cssText());
}
return text.toString();
}
bool CSSShadowValue::equals(const CSSShadowValue& other) const
{
return compareCSSValuePtr(color, other.color)
&& compareCSSValuePtr(x, other.x)
&& compareCSSValuePtr(y, other.y)
&& compareCSSValuePtr(blur, other.blur)
&& compareCSSValuePtr(spread, other.spread)
&& compareCSSValuePtr(style, other.style);
}
void CSSShadowValue::traceAfterDispatch(Visitor* visitor)
{
visitor->trace(x);
visitor->trace(y);
visitor->trace(blur);
visitor->trace(spread);
visitor->trace(style);
visitor->trace(color);
CSSValue::traceAfterDispatch(visitor);
}
}