StyleRareInheritedData.cpp [plain text]
#include "config.h"
#include "StyleRareInheritedData.h"
#include "RenderStyle.h"
#include "RenderStyleConstants.h"
namespace WebCore {
StyleRareInheritedData::StyleRareInheritedData()
: textStrokeWidth(RenderStyle::initialTextStrokeWidth())
, textShadow(0)
, textSecurity(RenderStyle::initialTextSecurity())
, userModify(READ_ONLY)
, wordBreak(RenderStyle::initialWordBreak())
, wordWrap(RenderStyle::initialWordWrap())
, nbspMode(NBNORMAL)
, khtmlLineBreak(LBNORMAL)
, resize(RenderStyle::initialResize())
, userSelect(RenderStyle::initialUserSelect())
, colorSpace(DeviceColorSpace)
, touchCalloutEnabled(RenderStyle::initialTouchCalloutEnabled())
, tapHighlightColor(RenderStyle::initialTapHighlightColor())
, compositionFillColor(RenderStyle::initialCompositionFillColor())
, compositionFrameColor(RenderStyle::initialCompositionFrameColor())
, textSizeAdjust(RenderStyle::initialTextSizeAdjust())
{
}
StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
: RefCounted<StyleRareInheritedData>()
, textStrokeColor(o.textStrokeColor)
, textStrokeWidth(o.textStrokeWidth)
, textFillColor(o.textFillColor)
, textShadow(o.textShadow ? new ShadowData(*o.textShadow) : 0)
, highlight(o.highlight)
, textSecurity(o.textSecurity)
, userModify(o.userModify)
, wordBreak(o.wordBreak)
, wordWrap(o.wordWrap)
, nbspMode(o.nbspMode)
, khtmlLineBreak(o.khtmlLineBreak)
, resize(o.resize)
, userSelect(o.userSelect)
, colorSpace(o.colorSpace)
, touchCalloutEnabled(o.touchCalloutEnabled)
, tapHighlightColor(o.tapHighlightColor)
, compositionFillColor(o.compositionFillColor)
, compositionFrameColor(o.compositionFrameColor)
, textSizeAdjust(o.textSizeAdjust)
{
}
StyleRareInheritedData::~StyleRareInheritedData()
{
delete textShadow;
}
bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
{
return textStrokeColor == o.textStrokeColor
&& textStrokeWidth == o.textStrokeWidth
&& textFillColor == o.textFillColor
&& shadowDataEquivalent(o)
&& highlight == o.highlight
&& textSecurity == o.textSecurity
&& userModify == o.userModify
&& wordBreak == o.wordBreak
&& wordWrap == o.wordWrap
&& nbspMode == o.nbspMode
&& khtmlLineBreak == o.khtmlLineBreak
&& textSizeAdjust == o.textSizeAdjust
&& resize == o.resize
&& userSelect == o.userSelect
&& colorSpace == o.colorSpace
&& tapHighlightColor == o.tapHighlightColor
&& touchCalloutEnabled == o.touchCalloutEnabled
&& compositionFillColor == o.compositionFillColor
&& compositionFrameColor == o.compositionFrameColor
;
}
bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
{
if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow))
return false;
if (textShadow && o.textShadow && (*textShadow != *o.textShadow))
return false;
return true;
}
}