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

Unified Diff: Source/core/layout/style/SVGLayoutStyle.h

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: lengthSetterForProperty Created 5 years, 9 months 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
« no previous file with comments | « Source/core/layout/style/LayoutStyle.h ('k') | Source/core/layout/style/SVGLayoutStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/style/SVGLayoutStyle.h
diff --git a/Source/core/layout/style/SVGLayoutStyle.h b/Source/core/layout/style/SVGLayoutStyle.h
index 29f3540c5af1e2cdc3dc453d6e3c5c3cb7987efd..f87dd45759144f1b9fbcd45a67686470d03bd044 100644
--- a/Source/core/layout/style/SVGLayoutStyle.h
+++ b/Source/core/layout/style/SVGLayoutStyle.h
@@ -78,6 +78,7 @@ public:
static PassRefPtr<SVGDashArray> initialStrokeDashArray();
static Length initialStrokeDashOffset() { return Length(Fixed); }
static float initialStrokeMiterLimit() { return 4; }
+ static UnzoomedLength initialStrokeWidth() { return UnzoomedLength(Length(1, Fixed)); }
static float initialStopOpacity() { return 1; }
static Color initialStopColor() { return Color(0, 0, 0); }
static float initialFloodOpacity() { return 1; }
@@ -96,13 +97,6 @@ public:
static Length initialRx() { return Length(Fixed); }
static Length initialRy() { return Length(Fixed); }
- static PassRefPtrWillBeRawPtr<SVGLength> initialStrokeWidth()
- {
- RefPtrWillBeRawPtr<SVGLength> length = SVGLength::create();
- length->newValueSpecifiedUnits(LengthTypeNumber, 1);
- return length.release();
- }
-
// SVG CSS Property setters
void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f._alignmentBaseline = val; }
void setDominantBaseline(EDominantBaseline val) { svg_noninherited_flags.f._dominantBaseline = val; }
@@ -207,10 +201,10 @@ public:
stroke.access()->miterLimit = obj;
}
- void setStrokeWidth(PassRefPtrWillBeRawPtr<SVGLength> obj)
+ void setStrokeWidth(const UnzoomedLength& strokeWidth)
{
- if (*stroke->width != *obj)
- stroke.access()->width = obj;
+ if (!(stroke->width == strokeWidth))
+ stroke.access()->width = strokeWidth;
}
void setStrokeDashOffset(const Length& dashOffset)
@@ -321,7 +315,7 @@ public:
const String& strokePaintUri() const { return stroke->paintUri; }
SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); }
float strokeMiterLimit() const { return stroke->miterLimit; }
- SVGLength* strokeWidth() const { return stroke->width.get(); }
+ const UnzoomedLength& strokeWidth() const { return stroke->width; }
const Length& strokeDashOffset() const { return stroke->dashOffset; }
float stopOpacity() const { return stops->opacity; }
const Color& stopColor() const { return stops->color; }
@@ -356,7 +350,7 @@ public:
bool hasFilter() const { return !filterResource().isEmpty(); }
bool hasMarkers() const { return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || !markerEndResource().isEmpty(); }
bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; }
- bool hasVisibleStroke() const { return hasStroke() && !strokeWidth()->isZero(); }
+ bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(); }
bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; }
bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writingMode() == WM_TB; }
« no previous file with comments | « Source/core/layout/style/LayoutStyle.h ('k') | Source/core/layout/style/SVGLayoutStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698