Commit 63d5b8ed authored by andersca@apple.com's avatar andersca@apple.com

Reviewed by Darin.

        Make more style objects start out with a refcount of 1.
        
        * rendering/RenderStyle.cpp:
        (WebCore::StyleSurroundData::StyleSurroundData):
        (WebCore::StyleBoxData::StyleBoxData):
        (WebCore::StyleVisualData::StyleVisualData):
        (WebCore::StyleBackgroundData::StyleBackgroundData):
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
        (WebCore::StyleInheritedData::StyleInheritedData):
        * rendering/RenderStyle.h:
        (WebCore::StyleSurroundData::create):
        (WebCore::StyleSurroundData::copy):
        (WebCore::StyleBoxData::create):
        (WebCore::StyleBoxData::copy):
        (WebCore::StyleVisualData::create):
        (WebCore::StyleVisualData::copy):
        (WebCore::StyleBackgroundData::create):
        (WebCore::StyleBackgroundData::copy):
        (WebCore::StyleBackgroundData::~StyleBackgroundData):
        (WebCore::StyleRareNonInheritedData::create):
        (WebCore::StyleRareNonInheritedData::copy):
        (WebCore::StyleRareInheritedData::create):
        (WebCore::StyleRareInheritedData::copy):
        (WebCore::StyleInheritedData::create):
        (WebCore::StyleInheritedData::copy):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5c3a52de
2008-02-25 Anders Carlsson <andersca@apple.com>
Reviewed by Darin.
Make more style objects start out with a refcount of 1.
* rendering/RenderStyle.cpp:
(WebCore::StyleSurroundData::StyleSurroundData):
(WebCore::StyleBoxData::StyleBoxData):
(WebCore::StyleVisualData::StyleVisualData):
(WebCore::StyleBackgroundData::StyleBackgroundData):
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleInheritedData::StyleInheritedData):
* rendering/RenderStyle.h:
(WebCore::StyleSurroundData::create):
(WebCore::StyleSurroundData::copy):
(WebCore::StyleBoxData::create):
(WebCore::StyleBoxData::copy):
(WebCore::StyleVisualData::create):
(WebCore::StyleVisualData::copy):
(WebCore::StyleBackgroundData::create):
(WebCore::StyleBackgroundData::copy):
(WebCore::StyleBackgroundData::~StyleBackgroundData):
(WebCore::StyleRareNonInheritedData::create):
(WebCore::StyleRareNonInheritedData::copy):
(WebCore::StyleRareInheritedData::create):
(WebCore::StyleRareInheritedData::copy):
(WebCore::StyleInheritedData::create):
(WebCore::StyleInheritedData::copy):
2008-02-25 Anders Carlsson <andersca@apple.com>
Reviewed by Darin.
......@@ -30,13 +30,13 @@ namespace WebCore {
static RenderStyle* defaultStyle;
StyleSurroundData::StyleSurroundData()
: RefCounted<StyleSurroundData>(0)
, margin(Fixed), padding(Fixed)
: margin(Fixed)
, padding(Fixed)
{
}
StyleSurroundData::StyleSurroundData(const StyleSurroundData& o)
: RefCounted<StyleSurroundData>(0)
: RefCounted<StyleSurroundData>()
, offset(o.offset)
, margin(o.margin)
, padding(o.padding)
......@@ -50,8 +50,9 @@ bool StyleSurroundData::operator==(const StyleSurroundData& o) const
}
StyleBoxData::StyleBoxData()
: RefCounted<StyleBoxData>(0)
, z_index(0), z_auto(true), boxSizing(CONTENT_BOX)
: z_index(0)
, z_auto(true)
, boxSizing(CONTENT_BOX)
{
// Initialize our min/max widths/heights.
min_width = min_height = RenderStyle::initialMinSize();
......@@ -59,7 +60,7 @@ StyleBoxData::StyleBoxData()
}
StyleBoxData::StyleBoxData(const StyleBoxData& o)
: RefCounted<StyleBoxData>(0)
: RefCounted<StyleBoxData>()
, width(o.width)
, height(o.height)
, min_width(o.min_width)
......@@ -86,8 +87,7 @@ bool StyleBoxData::operator==(const StyleBoxData& o) const
}
StyleVisualData::StyleVisualData()
: RefCounted<StyleVisualData>(0)
, hasClip(false)
: hasClip(false)
, textDecoration(RenderStyle::initialTextDecoration())
, counterIncrement(0)
, counterReset(0)
......@@ -99,7 +99,7 @@ StyleVisualData::~StyleVisualData()
}
StyleVisualData::StyleVisualData(const StyleVisualData& o)
: RefCounted<StyleVisualData>(0)
: RefCounted<StyleVisualData>()
, clip(o.clip)
, hasClip(o.hasClip)
, textDecoration(o.textDecoration)
......@@ -321,12 +321,13 @@ void BackgroundLayer::cullEmptyLayers()
}
StyleBackgroundData::StyleBackgroundData()
: RefCounted<StyleBackgroundData>(0)
{
}
StyleBackgroundData::StyleBackgroundData(const StyleBackgroundData& o)
: RefCounted<StyleBackgroundData>(0), m_background(o.m_background), m_outline(o.m_outline)
: RefCounted<StyleBackgroundData>()
, m_background(o.m_background)
, m_outline(o.m_outline)
{
}
......@@ -652,8 +653,7 @@ void Transition::fillUnsetProperties()
}
StyleRareNonInheritedData::StyleRareNonInheritedData()
: RefCounted<StyleRareNonInheritedData>(0)
, lineClamp(RenderStyle::initialLineClamp())
: lineClamp(RenderStyle::initialLineClamp())
, opacity(RenderStyle::initialOpacity())
, m_content(0)
, m_counterDirectives(0)
......@@ -673,7 +673,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
}
StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInheritedData& o)
: RefCounted<StyleRareNonInheritedData>(0)
: RefCounted<StyleRareNonInheritedData>()
, lineClamp(o.lineClamp)
, opacity(o.opacity)
, flexibleBox(o.flexibleBox)
......@@ -765,8 +765,7 @@ bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInher
}
StyleRareInheritedData::StyleRareInheritedData()
: RefCounted<StyleRareInheritedData>(0)
, textStrokeWidth(RenderStyle::initialTextStrokeWidth())
: textStrokeWidth(RenderStyle::initialTextStrokeWidth())
, textShadow(0)
, textSecurity(RenderStyle::initialTextSecurity())
, userModify(READ_ONLY)
......@@ -781,7 +780,7 @@ StyleRareInheritedData::StyleRareInheritedData()
}
StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
: RefCounted<StyleRareInheritedData>(0)
: RefCounted<StyleRareInheritedData>()
, textStrokeColor(o.textStrokeColor)
, textStrokeWidth(o.textStrokeWidth)
, textFillColor(o.textFillColor)
......@@ -831,8 +830,7 @@ bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData&
}
StyleInheritedData::StyleInheritedData()
: RefCounted<StyleInheritedData>(0)
, indent(RenderStyle::initialTextIndent())
: indent(RenderStyle::initialTextIndent())
, line_height(RenderStyle::initialLineHeight())
, style_image(RenderStyle::initialListStyleImage())
, color(RenderStyle::initialColor())
......@@ -849,15 +847,15 @@ StyleInheritedData::~StyleInheritedData()
}
StyleInheritedData::StyleInheritedData(const StyleInheritedData& o)
: RefCounted<StyleInheritedData>(0)
: RefCounted<StyleInheritedData>()
, indent(o.indent)
, line_height(o.line_height)
, style_image( o.style_image)
, style_image(o.style_image)
, cursorData(o.cursorData)
, font(o.font)
, color(o.color)
, horizontal_border_spacing( o.horizontal_border_spacing)
, vertical_border_spacing( o.vertical_border_spacing)
, horizontal_border_spacing(o.horizontal_border_spacing)
, vertical_border_spacing(o.vertical_border_spacing)
, widows(o.widows)
, orphans(o.orphans)
, page_break_inside(o.page_break_inside)
......
......@@ -315,8 +315,8 @@ enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
class StyleSurroundData : public RefCounted<StyleSurroundData> {
public:
StyleSurroundData();
StyleSurroundData(const StyleSurroundData& o);
static PassRefPtr<StyleSurroundData> create() { return adoptRef(new StyleSurroundData); }
PassRefPtr<StyleSurroundData> copy() const { return adoptRef(new StyleSurroundData(*this)); }
bool operator==(const StyleSurroundData& o) const;
bool operator!=(const StyleSurroundData& o) const {
......@@ -327,6 +327,10 @@ public:
LengthBox margin;
LengthBox padding;
BorderData border;
private:
StyleSurroundData();
StyleSurroundData(const StyleSurroundData&);
};
......@@ -337,12 +341,8 @@ enum EBoxSizing { CONTENT_BOX, BORDER_BOX };
class StyleBoxData : public RefCounted<StyleBoxData> {
public:
StyleBoxData();
StyleBoxData(const StyleBoxData& o);
// copy and assignment
// StyleBoxData(const StyleBoxData &other);
// const StyleBoxData &operator = (const StyleBoxData &other);
static PassRefPtr<StyleBoxData> create() { return adoptRef(new StyleBoxData); }
PassRefPtr<StyleBoxData> copy() const { return adoptRef(new StyleBoxData(*this)); }
bool operator==(const StyleBoxData& o) const;
bool operator!=(const StyleBoxData& o) const {
......@@ -363,6 +363,10 @@ public:
int z_index;
bool z_auto : 1;
unsigned boxSizing : 1; // EBoxSizing
private:
StyleBoxData();
StyleBoxData(const StyleBoxData&);
};
//------------------------------------------------
......@@ -416,9 +420,9 @@ enum EUnicodeBidi {
class StyleVisualData : public RefCounted<StyleVisualData> {
public:
StyleVisualData();
static PassRefPtr<StyleVisualData> create() { return adoptRef(new StyleVisualData); }
PassRefPtr<StyleVisualData> copy() const { return adoptRef(new StyleVisualData(*this)); }
~StyleVisualData();
StyleVisualData(const StyleVisualData&);
bool operator==(const StyleVisualData& o) const {
return ( clip == o.clip &&
......@@ -436,6 +440,9 @@ public:
short counterIncrement; // ok, so these are not visual mode specific
short counterReset; // can't go to inherited, since these are not inherited
private:
StyleVisualData();
StyleVisualData(const StyleVisualData&);
};
//------------------------------------------------
......@@ -554,9 +561,9 @@ public:
class StyleBackgroundData : public RefCounted<StyleBackgroundData> {
public:
StyleBackgroundData();
static PassRefPtr<StyleBackgroundData> create() { return adoptRef(new StyleBackgroundData); }
PassRefPtr<StyleBackgroundData> copy() const { return adoptRef(new StyleBackgroundData(*this)); }
~StyleBackgroundData() {}
StyleBackgroundData(const StyleBackgroundData& o );
bool operator==(const StyleBackgroundData& o) const;
bool operator!=(const StyleBackgroundData &o) const {
......@@ -566,6 +573,10 @@ public:
BackgroundLayer m_background;
Color m_color;
OutlineValue m_outline;
private:
StyleBackgroundData();
StyleBackgroundData(const StyleBackgroundData& o );
};
//------------------------------------------------
......@@ -594,7 +605,7 @@ public:
private:
StyleMarqueeData();
StyleMarqueeData(const StyleMarqueeData& o);
StyleMarqueeData(const StyleMarqueeData&);
};
// CSS3 Multi Column Layout
......@@ -629,7 +640,7 @@ public:
private:
StyleMultiColData();
StyleMultiColData(const StyleMultiColData& o);
StyleMultiColData(const StyleMultiColData&);
};
// CSS Transforms (may become part of CSS3)
......@@ -873,7 +884,7 @@ public:
private:
StyleFlexibleBoxData();
StyleFlexibleBoxData(const StyleFlexibleBoxData& o);
StyleFlexibleBoxData(const StyleFlexibleBoxData&);
};
// This struct holds information about shadows for the text-shadow and box-shadow properties.
......@@ -1143,10 +1154,10 @@ public:
// actually uses one of these properties.
class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> {
public:
StyleRareNonInheritedData();
static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
~StyleRareNonInheritedData();
StyleRareNonInheritedData(const StyleRareNonInheritedData&);
#if ENABLE(XBL)
bool bindingsEquivalent(const StyleRareNonInheritedData&) const;
#endif
......@@ -1183,6 +1194,10 @@ public:
#if ENABLE(XBL)
BindingURI* bindingURI; // The XBL binding URI list.
#endif
private:
StyleRareNonInheritedData();
StyleRareNonInheritedData(const StyleRareNonInheritedData&);
};
// This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties.
......@@ -1190,9 +1205,9 @@ public:
// actually uses one of these properties.
class StyleRareInheritedData : public RefCounted<StyleRareInheritedData> {
public:
StyleRareInheritedData();
static PassRefPtr<StyleRareInheritedData> create() { return adoptRef(new StyleRareInheritedData); }
PassRefPtr<StyleRareInheritedData> copy() const { return adoptRef(new StyleRareInheritedData(*this)); }
~StyleRareInheritedData();
StyleRareInheritedData(const StyleRareInheritedData& o);
bool operator==(const StyleRareInheritedData& o) const;
bool operator!=(const StyleRareInheritedData &o) const {
......@@ -1215,6 +1230,10 @@ public:
bool textSizeAdjust : 1; // An Apple extension.
unsigned resize : 2; // EResize
unsigned userSelect : 1; // EUserSelect
private:
StyleRareInheritedData();
StyleRareInheritedData(const StyleRareInheritedData&);
};
//------------------------------------------------
......@@ -1243,10 +1262,10 @@ enum EPageBreak {
class StyleInheritedData : public RefCounted<StyleInheritedData> {
public:
StyleInheritedData();
static PassRefPtr<StyleInheritedData> create() { return adoptRef(new StyleInheritedData); }
PassRefPtr<StyleInheritedData> copy() const { return adoptRef(new StyleInheritedData(*this)); }
~StyleInheritedData();
StyleInheritedData(const StyleInheritedData& o );
bool operator==(const StyleInheritedData& o) const;
bool operator != ( const StyleInheritedData &o ) const {
return !(*this == o);
......@@ -1270,6 +1289,10 @@ public:
short widows;
short orphans;
unsigned page_break_inside : 2; // EPageBreak
private:
StyleInheritedData();
StyleInheritedData(const StyleInheritedData&);
};
......@@ -1466,15 +1489,15 @@ protected:
} noninherited_flags;
// non-inherited attributes
DeprecatedDataRef<StyleBoxData> box;
DeprecatedDataRef<StyleVisualData> visual;
DeprecatedDataRef<StyleBackgroundData> background;
DeprecatedDataRef<StyleSurroundData> surround;
DeprecatedDataRef<StyleRareNonInheritedData> rareNonInheritedData;
DataRef<StyleBoxData> box;
DataRef<StyleVisualData> visual;
DataRef<StyleBackgroundData> background;
DataRef<StyleSurroundData> surround;
DataRef<StyleRareNonInheritedData> rareNonInheritedData;
// inherited attributes
DeprecatedDataRef<StyleRareInheritedData> rareInheritedData;
DeprecatedDataRef<StyleInheritedData> inherited;
DataRef<StyleRareInheritedData> rareInheritedData;
DataRef<StyleInheritedData> inherited;
// list of associated pseudo styles
RenderStyle* pseudoStyle;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment