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

Unified Diff: Source/core/svg/SVGAngleTearOff.h

Issue 303263008: [SVG2] Add support for the 'turn' unit in <angle>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixups for MathExtras Created 6 years, 6 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/svg/SVGAngle.cpp ('k') | Source/core/svg/SVGAngleTearOff.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAngleTearOff.h
diff --git a/Source/core/svg/SVGAngleTearOff.h b/Source/core/svg/SVGAngleTearOff.h
index 8d6d52084b908acc61113efec7c7ae437ba1a538..8b7e50cb1e2670385dc02a97390b7a9e4a7f0edd 100644
--- a/Source/core/svg/SVGAngleTearOff.h
+++ b/Source/core/svg/SVGAngleTearOff.h
@@ -54,7 +54,7 @@ public:
virtual ~SVGAngleTearOff();
- unsigned short unitType() { return target()->unitType(); }
+ unsigned short unitType() { return hasExposedAngleUnit() ? target()->unitType() : SVGAngle::SVG_ANGLETYPE_UNKNOWN; }
void setValue(float, ExceptionState&);
float value() { return target()->value(); }
@@ -65,11 +65,13 @@ public:
void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionState&);
void convertToSpecifiedUnits(unsigned short unitType, ExceptionState&);
- String valueAsString() { return target()->valueAsString(); }
+ String valueAsString() { return hasExposedAngleUnit() ? target()->valueAsString() : String::number(0); }
void setValueAsString(const String&, ExceptionState&);
private:
SVGAngleTearOff(PassRefPtr<SVGAngle>, SVGElement*, PropertyIsAnimValType, const QualifiedName&);
+
+ bool hasExposedAngleUnit() { return target()->unitType() <= SVGAngle::SVG_ANGLETYPE_GRAD; }
};
} // namespace WebCore
« no previous file with comments | « Source/core/svg/SVGAngle.cpp ('k') | Source/core/svg/SVGAngleTearOff.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698