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: https://svn.webkit.org/repository/webkit/trunk@30573
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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.
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)
}
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();
}
StyleBoxData::StyleBoxData(const StyleBoxData& o)
- : RefCounted<StyleBoxData>(0)
+ : RefCounted<StyleBoxData>()
, width(o.width)
, height(o.height)
, min_width(o.min_width)
}
StyleVisualData::StyleVisualData()
- : RefCounted<StyleVisualData>(0)
- , hasClip(false)
+ : hasClip(false)
, textDecoration(RenderStyle::initialTextDecoration())
, counterIncrement(0)
, counterReset(0)
}
StyleVisualData::StyleVisualData(const StyleVisualData& o)
- : RefCounted<StyleVisualData>(0)
+ : RefCounted<StyleVisualData>()
, clip(o.clip)
, hasClip(o.hasClip)
, textDecoration(o.textDecoration)
}
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)
{
}
}
StyleRareNonInheritedData::StyleRareNonInheritedData()
- : RefCounted<StyleRareNonInheritedData>(0)
- , lineClamp(RenderStyle::initialLineClamp())
+ : lineClamp(RenderStyle::initialLineClamp())
, opacity(RenderStyle::initialOpacity())
, m_content(0)
, m_counterDirectives(0)
}
StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInheritedData& o)
- : RefCounted<StyleRareNonInheritedData>(0)
+ : RefCounted<StyleRareNonInheritedData>()
, lineClamp(o.lineClamp)
, opacity(o.opacity)
, flexibleBox(o.flexibleBox)
}
StyleRareInheritedData::StyleRareInheritedData()
- : RefCounted<StyleRareInheritedData>(0)
- , textStrokeWidth(RenderStyle::initialTextStrokeWidth())
+ : textStrokeWidth(RenderStyle::initialTextStrokeWidth())
, textShadow(0)
, textSecurity(RenderStyle::initialTextSecurity())
, userModify(READ_ONLY)
}
StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
- : RefCounted<StyleRareInheritedData>(0)
+ : RefCounted<StyleRareInheritedData>()
, textStrokeColor(o.textStrokeColor)
, textStrokeWidth(o.textStrokeWidth)
, textFillColor(o.textFillColor)
}
StyleInheritedData::StyleInheritedData()
- : RefCounted<StyleInheritedData>(0)
- , indent(RenderStyle::initialTextIndent())
+ : indent(RenderStyle::initialTextIndent())
, line_height(RenderStyle::initialLineHeight())
, style_image(RenderStyle::initialListStyleImage())
, color(RenderStyle::initialColor())
}
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)
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 {
LengthBox margin;
LengthBox padding;
BorderData border;
+
+private:
+ StyleSurroundData();
+ StyleSurroundData(const StyleSurroundData&);
};
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 {
int z_index;
bool z_auto : 1;
unsigned boxSizing : 1; // EBoxSizing
+
+private:
+ StyleBoxData();
+ StyleBoxData(const StyleBoxData&);
};
//------------------------------------------------
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 &&
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&);
};
//------------------------------------------------
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 {
BackgroundLayer m_background;
Color m_color;
OutlineValue m_outline;
+
+private:
+ StyleBackgroundData();
+ StyleBackgroundData(const StyleBackgroundData& o );
};
//------------------------------------------------
private:
StyleMarqueeData();
- StyleMarqueeData(const StyleMarqueeData& o);
+ StyleMarqueeData(const StyleMarqueeData&);
};
// CSS3 Multi Column Layout
private:
StyleMultiColData();
- StyleMultiColData(const StyleMultiColData& o);
+ StyleMultiColData(const StyleMultiColData&);
};
// CSS Transforms (may become part of CSS3)
private:
StyleFlexibleBoxData();
- StyleFlexibleBoxData(const StyleFlexibleBoxData& o);
+ StyleFlexibleBoxData(const StyleFlexibleBoxData&);
};
// This struct holds information about shadows for the text-shadow and box-shadow properties.
// 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
#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.
// 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 {
bool textSizeAdjust : 1; // An Apple extension.
unsigned resize : 2; // EResize
unsigned userSelect : 1; // EUserSelect
+
+private:
+ StyleRareInheritedData();
+ StyleRareInheritedData(const StyleRareInheritedData&);
};
//------------------------------------------------
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);
short widows;
short orphans;
unsigned page_break_inside : 2; // EPageBreak
+
+private:
+ StyleInheritedData();
+ StyleInheritedData(const StyleInheritedData&);
};
} 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;