Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: Source/core/rendering/style/SVGRenderStyle.h

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/style/SVGRenderStyle.h
diff --git a/Source/core/rendering/style/SVGRenderStyle.h b/Source/core/rendering/style/SVGRenderStyle.h
index dba333e1ddfae429d4b3ea17d5e52269758cd115..ec343706de73312f11e49b711bdf93a552a0d797 100644
--- a/Source/core/rendering/style/SVGRenderStyle.h
+++ b/Source/core/rendering/style/SVGRenderStyle.h
@@ -79,7 +79,7 @@ public:
static SVGPaint::SVGPaintType initialStrokePaintType() { return SVGPaint::SVG_PAINTTYPE_NONE; }
static Color initialStrokePaintColor() { return Color(); }
static String initialStrokePaintUri() { return String(); }
- static Vector<SVGLength> initialStrokeDashArray() { return Vector<SVGLength>(); }
+ static PassRefPtr<SVGLengthList> initialStrokeDashArray() { return SVGLengthList::create(); }
static float initialStrokeMiterLimit() { return 4; }
static float initialStopOpacity() { return 1; }
static Color initialStopColor() { return Color(0, 0, 0); }
@@ -95,32 +95,32 @@ public:
static EMaskType initialMaskType() { return MT_LUMINANCE; }
static EPaintOrder initialPaintOrder() { return PO_NORMAL; }
- static SVGLength initialBaselineShiftValue()
+ static PassRefPtr<SVGLength> initialBaselineShiftValue()
{
- SVGLength length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
- return length;
+ RefPtr<SVGLength> length = SVGLength::create();
+ length->newValueSpecifiedUnits(LengthTypeNumber, 0);
+ return length.release();
}
- static SVGLength initialKerning()
+ static PassRefPtr<SVGLength> initialKerning()
{
- SVGLength length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
- return length;
+ RefPtr<SVGLength> length = SVGLength::create();
+ length->newValueSpecifiedUnits(LengthTypeNumber, 0);
+ return length.release();
}
- static SVGLength initialStrokeDashOffset()
+ static PassRefPtr<SVGLength> initialStrokeDashOffset()
{
- SVGLength length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 0, ASSERT_NO_EXCEPTION);
- return length;
+ RefPtr<SVGLength> length = SVGLength::create();
+ length->newValueSpecifiedUnits(LengthTypeNumber, 0);
+ return length.release();
}
- static SVGLength initialStrokeWidth()
+ static PassRefPtr<SVGLength> initialStrokeWidth()
{
- SVGLength length;
- length.newValueSpecifiedUnits(LengthTypeNumber, 1, ASSERT_NO_EXCEPTION);
- return length;
+ RefPtr<SVGLength> length = SVGLength::create();
+ length->newValueSpecifiedUnits(LengthTypeNumber, 1);
+ return length.release();
}
// SVG CSS Property setters
@@ -196,7 +196,7 @@ public:
}
}
- void setStrokeDashArray(const Vector<SVGLength>& obj)
+ void setStrokeDashArray(PassRefPtr<SVGLengthList> obj)
{
if (!(stroke->dashArray == obj))
stroke.access()->dashArray = obj;
@@ -208,19 +208,19 @@ public:
stroke.access()->miterLimit = obj;
}
- void setStrokeWidth(const SVGLength& obj)
+ void setStrokeWidth(PassRefPtr<SVGLength> obj)
{
if (!(stroke->width == obj))
stroke.access()->width = obj;
}
- void setStrokeDashOffset(const SVGLength& obj)
+ void setStrokeDashOffset(PassRefPtr<SVGLength> obj)
{
if (!(stroke->dashOffset == obj))
stroke.access()->dashOffset = obj;
}
- void setKerning(const SVGLength& obj)
+ void setKerning(PassRefPtr<SVGLength> obj)
{
if (!(text->kerning == obj))
text.access()->kerning = obj;
@@ -256,7 +256,7 @@ public:
misc.access()->lightingColor = obj;
}
- void setBaselineShiftValue(const SVGLength& obj)
+ void setBaselineShiftValue(PassRefPtr<SVGLength> obj)
{
if (!(misc->baselineShiftValue == obj))
misc.access()->baselineShiftValue = obj;
@@ -326,17 +326,17 @@ public:
const SVGPaint::SVGPaintType& strokePaintType() const { return stroke->paintType; }
const Color& strokePaintColor() const { return stroke->paintColor; }
const String& strokePaintUri() const { return stroke->paintUri; }
- Vector<SVGLength> strokeDashArray() const { return stroke->dashArray; }
+ SVGLengthList* strokeDashArray() const { return stroke->dashArray.get(); }
float strokeMiterLimit() const { return stroke->miterLimit; }
- SVGLength strokeWidth() const { return stroke->width; }
- SVGLength strokeDashOffset() const { return stroke->dashOffset; }
- SVGLength kerning() const { return text->kerning; }
+ SVGLength* strokeWidth() const { return stroke->width.get(); }
+ SVGLength* strokeDashOffset() const { return stroke->dashOffset.get(); }
+ SVGLength* kerning() const { return text->kerning.get(); }
float stopOpacity() const { return stops->opacity; }
const Color& stopColor() const { return stops->color; }
float floodOpacity() const { return misc->floodOpacity; }
const Color& floodColor() const { return misc->floodColor; }
const Color& lightingColor() const { return misc->lightingColor; }
- SVGLength baselineShiftValue() const { return misc->baselineShiftValue; }
+ SVGLength* baselineShiftValue() const { return misc->baselineShiftValue.get(); }
String clipperResource() const { return resources->clipper; }
String filterResource() const { return resources->filter; }
String maskerResource() const { return resources->masker; }
@@ -360,7 +360,7 @@ public:
bool hasFilter() const { return !filterResource().isEmpty(); }
bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); }
bool hasStroke() const { return strokePaintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
- bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(); }
+ bool hasVisibleStroke() const { return hasStroke() && !strokeWidth()->isZero(); }
bool hasFill() const { return fillPaintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writingMode() == WM_TB; }

Powered by Google App Engine
This is Rietveld 408576698