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

Unified Diff: third_party/WebKit/Source/core/svg/SVGLength.h

Issue 2097383002: Added support of calc() for SVGLength (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 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
Index: third_party/WebKit/Source/core/svg/SVGLength.h
diff --git a/third_party/WebKit/Source/core/svg/SVGLength.h b/third_party/WebKit/Source/core/svg/SVGLength.h
index 089e8f8f1af11673dc44bbc561833d47806c4ba2..7d6f773e8ef240e9e9543d6aa1dd024f8a974ca0 100644
--- a/third_party/WebKit/Source/core/svg/SVGLength.h
+++ b/third_party/WebKit/Source/core/svg/SVGLength.h
@@ -56,6 +56,7 @@ public:
float value(const SVGLengthContext&) const;
void setValue(float, const SVGLengthContext&);
+ void setValueAsNumber(float);
float valueInSpecifiedUnits() const { return m_value->getFloatValue(); }
void setValueInSpecifiedUnits(float value)
@@ -82,6 +83,7 @@ public:
// Helper functions
inline bool isRelative() const { return CSSPrimitiveValue::isRelativeUnit(m_value->typeWithCalcResolved()); }
+ inline bool isCalculated() const { return m_value->isCalculated(); }
bool isZero() const
{
@@ -98,10 +100,15 @@ public:
static AnimatedPropertyType classType() { return AnimatedLength; }
AnimatedPropertyType type() const override { return classType(); }
+ static CSSPrimitiveValue::UnitType toUnitType(int lengthUnitType)
+ {
+ return static_cast<CSSPrimitiveValue::UnitType>(CSSPrimitiveValue::lengthUnitTypeToUnitType(static_cast<CSSPrimitiveValue::LengthUnitType>(lengthUnitType)));
fs 2016/07/16 21:13:02 Shouldn't need to cast what lengthUnitTypeToUnitTy
Shanmuga Pandi 2016/07/18 13:35:33 Done.
+ }
private:
SVGLength(SVGLengthMode);
SVGLength(const SVGLength&);
+ float resolveCalcValue(const SVGLengthContext&) const;
Member<const CSSPrimitiveValue> m_value;
unsigned m_unitMode : 2;
};

Powered by Google App Engine
This is Rietveld 408576698