This source file includes following definitions.
- customCSSText
- equals
- traceAfterDispatch
#include "config.h"
#include "core/css/CSSFontValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/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);
}
void CSSFontValue::traceAfterDispatch(Visitor* visitor)
{
visitor->trace(style);
visitor->trace(variant);
visitor->trace(weight);
visitor->trace(size);
visitor->trace(lineHeight);
visitor->trace(family);
CSSValue::traceAfterDispatch(visitor);
}
}