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

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: set NeedsRebaseline 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
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | Source/core/svg/SVGSVGElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGSVGElement.cpp
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 6019b8b1e0810cce2083d97b3d90e84b6fa966d1..04c2f75aae2d8415197b89bbe6a5c4a72221024d 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())
{
ScriptWrappable::init(this);
@@ -207,9 +208,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() OVERRIDE
+ {
+ 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();
}
@@ -395,9 +421,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()
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | Source/core/svg/SVGSVGElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698