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

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

Issue 132233016: [SVG] SVGAnimatedPointList migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 70aca55658d08b54c463efbc3f7e2ae5293b9f10..96fb1cc51d19270cea1860415b834ef46c4f8edc 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -79,6 +79,7 @@ inline SVGSVGElement::SVGSVGElement(Document& doc)
, m_useCurrentView(false)
, m_zoomAndPan(SVGZoomAndPanMagnify)
, m_timeContainer(SMILTimeContainer::create(this))
+ , m_translation(SVGPoint::create())
, m_weakFactory(this)
{
ScriptWrappable::init(this);
@@ -205,9 +206,34 @@ void SVGSVGElement::setCurrentScale(float scale)
frame->setPageZoomFactor(scale);
}
-void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation)
+class SVGCurrentTranslateTearOff : public SVGPointTearOff {
+public:
+ static PassRefPtr<SVGCurrentTranslateTearOff> create(SVGSVGElement* contextElement)
+ {
+ return adoptRef(new SVGCurrentTranslateTearOff(contextElement));
+ }
+
+ virtual void commitChange()
+ {
+ ASSERT(contextElement());
+ toSVGSVGElement(contextElement())->updateCurrentTranslate();
+ }
+
+private:
+ SVGCurrentTranslateTearOff(SVGSVGElement* contextElement)
+ : SVGPointTearOff(contextElement->m_translation, contextElement, PropertyIsNotAnimVal)
+ {
+ }
+};
+
+PassRefPtr<SVGPointTearOff> SVGSVGElement::currentTranslateFromJavascript()
+{
+ return SVGCurrentTranslateTearOff::create(this);
+}
+
+void SVGSVGElement::setCurrentTranslate(const FloatPoint& point)
{
- m_translation = translation;
+ m_translation->setValue(point);
updateCurrentTranslate();
}
@@ -393,9 +419,9 @@ SVGAngle SVGSVGElement::createSVGAngle()
return SVGAngle();
}
-SVGPoint SVGSVGElement::createSVGPoint()
+PassRefPtr<SVGPointTearOff> SVGSVGElement::createSVGPoint()
{
- return SVGPoint();
+ return SVGPointTearOff::create(SVGPoint::create(), 0, PropertyIsNotAnimVal);
}
SVGMatrix SVGSVGElement::createSVGMatrix()

Powered by Google App Engine
This is Rietveld 408576698