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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGLength.h

Issue 1491023003: Refactor SVGAnimatedLength negative values mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 || unitType == CSSPrimitiveValue::UnitType::Chs; 97 || unitType == CSSPrimitiveValue::UnitType::Chs;
98 } 98 }
99 inline bool isRelative() const { return isRelativeUnit(m_value->typeWithCalc Resolved()); } 99 inline bool isRelative() const { return isRelativeUnit(m_value->typeWithCalc Resolved()); }
100 100
101 bool isZero() const 101 bool isZero() const
102 { 102 {
103 return m_value->getFloatValue() == 0; 103 return m_value->getFloatValue() == 0;
104 } 104 }
105 105
106 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam e&); 106 static SVGLengthMode lengthModeForAnimatedLengthAttribute(const QualifiedNam e&);
107 static SVGLengthNegativeValuesMode negativeValuesModeForAnimatedLengthAttrib ute(const QualifiedName&);
107 108
108 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; 109 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override;
109 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio nValue, SVGElement* contextElement) override; 110 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWillBeRawP tr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndOfDuratio nValue, SVGElement* contextElement) override;
110 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme nt* contextElement) override; 111 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme nt* contextElement) override;
111 112
112 static AnimatedPropertyType classType() { return AnimatedLength; } 113 static AnimatedPropertyType classType() { return AnimatedLength; }
113 114
114 private: 115 private:
115 SVGLength(SVGLengthMode); 116 SVGLength(SVGLengthMode);
116 SVGLength(const SVGLength&); 117 SVGLength(const SVGLength&);
117 118
118 RefPtrWillBeMember<CSSPrimitiveValue> m_value; 119 RefPtrWillBeMember<CSSPrimitiveValue> m_value;
119 unsigned m_unitMode : 2; 120 unsigned m_unitMode : 2;
120 }; 121 };
121 122
122 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength); 123 DEFINE_SVG_PROPERTY_TYPE_CASTS(SVGLength);
123 124
124 } // namespace blink 125 } // namespace blink
125 126
126 #endif // SVGLength_h 127 #endif // SVGLength_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698