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

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

Issue 148173018: [SVG] SVGAnimatedString{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove if 0 Created 6 years, 11 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: Source/core/svg/SVGStaticStringList.h
diff --git a/Source/core/svg/SVGAnimatedNumberOptionalNumber.h b/Source/core/svg/SVGStaticStringList.h
similarity index 57%
copy from Source/core/svg/SVGAnimatedNumberOptionalNumber.h
copy to Source/core/svg/SVGStaticStringList.h
index b9ff6018de0d99a67d1c2cfcf3186711f015e9fb..70d674f1f2fd8f0fd31eb25e80ab4f46dfdd64cf 100644
--- a/Source/core/svg/SVGAnimatedNumberOptionalNumber.h
+++ b/Source/core/svg/SVGStaticStringList.h
@@ -28,43 +28,49 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SVGAnimatedNumberOptionalNumber_h
-#define SVGAnimatedNumberOptionalNumber_h
+#ifndef SVGStaticStringList_h
+#define SVGStaticStringList_h
-#include "core/svg/SVGAnimatedNumber.h"
-#include "core/svg/SVGNumberOptionalNumber.h"
+#include "core/svg/SVGStringListTearOff.h"
+#include "core/svg/properties/NewSVGAnimatedProperty.h"
namespace WebCore {
-// SVG Spec: http://www.w3.org/TR/SVG11/types.html <number-optional-number>
-// Unlike other SVGAnimated* class, this class is not exposed to Javascript directly,
-// while DOM attribute and SMIL animations operate on this class.
-// From Javascript, the two SVGAnimatedNumbers |firstNumber| and |secondNumber| are used.
-// For example, see SVGFEDropShadowElement::stdDeviation{X,Y}()
-class SVGAnimatedNumberOptionalNumber : public NewSVGAnimatedPropertyCommon<SVGNumberOptionalNumber> {
+class SVGElement;
+
+// SVGStringList property implementations for SVGTests properties.
+// Inherits SVGAnimatedPropertyBase to enable XML attribute synchronization, but this is never animated.
+class SVGStaticStringList FINAL : public NewSVGAnimatedPropertyBase {
public:
- static PassRefPtr<SVGAnimatedNumberOptionalNumber> create(SVGElement* contextElement, const QualifiedName& attributeName, float initialFirstValue = 0, float initialSecondValue = 0)
+ static PassRefPtr<SVGStaticStringList> create(SVGElement* contextElement, const QualifiedName& attributeName)
{
- return adoptRef(new SVGAnimatedNumberOptionalNumber(contextElement, attributeName, initialFirstValue, initialSecondValue));
+ return adoptRef(new SVGStaticStringList(contextElement, attributeName));
}
+ virtual ~SVGStaticStringList();
+
+ // NewSVGAnimatedPropertyBase:
+ virtual NewSVGPropertyBase* currentValueBase() OVERRIDE;
virtual void animationStarted() OVERRIDE;
+ virtual PassRefPtr<NewSVGPropertyBase> createAnimatedValue() OVERRIDE;
virtual void setAnimatedValue(PassRefPtr<NewSVGPropertyBase>) OVERRIDE;
- virtual bool needsSynchronizeAttribute() OVERRIDE;
virtual void animationEnded() OVERRIDE;
virtual void animValWillChange() OVERRIDE;
virtual void animValDidChange() OVERRIDE;
+ virtual bool needsSynchronizeAttribute() OVERRIDE;
+
+ void setBaseValueAsString(const String& value, SVGParsingError& parseError);
- SVGAnimatedNumber* firstNumber() { return m_firstNumber.get(); }
- SVGAnimatedNumber* secondNumber() { return m_secondNumber.get(); }
+ SVGStringList* value() { return m_value.get(); }
+ SVGStringListTearOff* tearOff() { return m_tearOff.get(); }
-protected:
- SVGAnimatedNumberOptionalNumber(SVGElement* contextElement, const QualifiedName& attributeName, float initialFirstValue, float initialSecondValue);
+private:
+ SVGStaticStringList(SVGElement*, const QualifiedName&);
- RefPtr<SVGAnimatedNumber> m_firstNumber;
- RefPtr<SVGAnimatedNumber> m_secondNumber;
+ RefPtr<SVGStringList> m_value;
+ RefPtr<SVGStringListTearOff> m_tearOff;
};
-} // namespace WebCore
+}
-#endif // SVGAnimatedNumberOptionalNumber_h
+#endif

Powered by Google App Engine
This is Rietveld 408576698