#include "config.h"
#include "CSSFontValue.h"
#include "CSSPrimitiveValue.h"
#include "CSSValueList.h"
#include <wtf/text/StringBuilder.h>
namespace WebCore {
String CSSFontValue::customCSSText() const
{
StringBuilder result;
if (style)
result.append(style->cssText());
if (variant) {
if (!result.isEmpty())
result.append(' ');
result.append(variant->cssText());
}
if (weight) {
if (!result.isEmpty())
result.append(' ');
result.append(weight->cssText());
}
if (size) {
if (!result.isEmpty())
result.append(' ');
result.append(size->cssText());
}
if (lineHeight) {
if (!size)
result.append(' ');
result.append('/');
result.append(lineHeight->cssText());
}
if (family) {
if (!result.isEmpty())
result.append(' ');
result.append(family->cssText());
}
return result.toString();
}
bool CSSFontValue::equals(const CSSFontValue& other) const
{
return compareCSSValuePtr(style, other.style)
&& compareCSSValuePtr(variant, other.variant)
&& compareCSSValuePtr(weight, other.weight)
&& compareCSSValuePtr(size, other.size)
&& compareCSSValuePtr(lineHeight, other.lineHeight)
&& compareCSSValuePtr(family, other.family);
}
}