StyleBackgroundData.cpp [plain text]
#include "config.h"
#include "StyleBackgroundData.h"
#include "RenderStyle.h"
#include "RenderStyleConstants.h"
namespace WebCore {
StyleBackgroundData::StyleBackgroundData()
: m_background(BackgroundFillLayer)
, m_color(RenderStyle::initialBackgroundColor())
{
}
inline StyleBackgroundData::StyleBackgroundData(const StyleBackgroundData& o)
: RefCounted<StyleBackgroundData>()
, m_background(o.m_background)
, m_color(o.m_color)
, m_outline(o.m_outline)
{
}
PassRef<StyleBackgroundData> StyleBackgroundData::copy() const
{
return adoptRef(*new StyleBackgroundData(*this));
}
bool StyleBackgroundData::operator==(const StyleBackgroundData& o) const
{
return m_background == o.m_background && m_color == o.m_color && m_outline == o.m_outline;
}
bool StyleBackgroundData::isEquivalentForPainting(const StyleBackgroundData& other) const
{
if (m_background != other.m_background || m_color != other.m_color)
return false;
if (!m_outline.isVisible() && !other.m_outline.isVisible())
return true;
return m_outline == other.m_outline;
}
}