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

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

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.cpp
diff --git a/Source/core/svg/SVGAnimatedLength.cpp b/Source/core/svg/SVGStaticStringList.cpp
similarity index 56%
copy from Source/core/svg/SVGAnimatedLength.cpp
copy to Source/core/svg/SVGStaticStringList.cpp
index bc447b07280ebfb8d410374e1bd403a14d4851cc..4e68b13a90e2279ca4f261cbe5f1dbacfc824e8c 100644
--- a/Source/core/svg/SVGAnimatedLength.cpp
+++ b/Source/core/svg/SVGStaticStringList.cpp
@@ -29,28 +29,71 @@
*/
#include "config.h"
-
-#include "core/svg/SVGAnimatedLength.h"
+#include "core/svg/SVGStaticStringList.h"
namespace WebCore {
-void SVGAnimatedLength::setDefaultValueAsString(const String& value)
+SVGStaticStringList::SVGStaticStringList(SVGElement* contextElement, const QualifiedName& attributeName)
+ : NewSVGAnimatedPropertyBase(AnimatedStringList, contextElement, attributeName)
+ , m_value(SVGStringList::create())
+ , m_tearOff(SVGStringListTearOff::create(m_value, contextElement, PropertyIsNotAnimVal, attributeName))
+{
+ ASSERT(contextElement);
+}
+
+SVGStaticStringList::~SVGStaticStringList()
+{
+}
+
+NewSVGPropertyBase* SVGStaticStringList::currentValueBase()
+{
+ return m_value.get();
+}
+
+void SVGStaticStringList::animationStarted()
+{
+ ASSERT_NOT_REACHED();
+}
+
+PassRefPtr<NewSVGPropertyBase> SVGStaticStringList::createAnimatedValue()
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+void SVGStaticStringList::setAnimatedValue(PassRefPtr<NewSVGPropertyBase>)
+{
+ ASSERT_NOT_REACHED();
+}
+
+void SVGStaticStringList::animationEnded()
+{
+ ASSERT_NOT_REACHED();
+}
+
+void SVGStaticStringList::animValWillChange()
+{
+ ASSERT_NOT_REACHED();
+}
+
+void SVGStaticStringList::animValDidChange()
+{
+ ASSERT_NOT_REACHED();
+}
+
+bool SVGStaticStringList::needsSynchronizeAttribute()
{
- baseValue()->setValueAsString(value, ASSERT_NO_EXCEPTION);
+ return m_tearOff;
}
-void SVGAnimatedLength::setBaseValueAsString(const String& value, SVGLengthNegativeValuesMode mode, SVGParsingError& parseError)
+void SVGStaticStringList::setBaseValueAsString(const String& value, SVGParsingError& parseError)
{
TrackExceptionState es;
- baseValue()->setValueAsString(value, es);
+ m_value->setValueAsString(value, es);
- if (es.hadException()) {
+ if (es.hadException())
parseError = ParsingAttributeFailedError;
- baseValue()->newValueSpecifiedUnits(LengthTypeNumber, 0);
- } else if (mode == ForbidNegativeLengths && baseValue()->valueInSpecifiedUnits() < 0) {
- parseError = NegativeValueForbiddenError;
- }
}
}

Powered by Google App Engine
This is Rietveld 408576698