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

Unified Diff: Source/core/svg/SVGPointTearOff.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/SVGPointTearOff.h ('k') | Source/core/svg/SVGPolyElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPointTearOff.cpp
diff --git a/Source/core/svg/SVGRectTearOff.cpp b/Source/core/svg/SVGPointTearOff.cpp
similarity index 68%
copy from Source/core/svg/SVGRectTearOff.cpp
copy to Source/core/svg/SVGPointTearOff.cpp
index 64a2538c50c2656117137d6d704a5122264ff0b2..5081029c93a6f9331476f84ef3fe59882a6a9953 100644
--- a/Source/core/svg/SVGRectTearOff.cpp
+++ b/Source/core/svg/SVGPointTearOff.cpp
@@ -30,20 +30,21 @@
#include "config.h"
-#include "core/svg/SVGRectTearOff.h"
+#include "core/svg/SVGPointTearOff.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
+#include "core/svg/SVGMatrix.h"
namespace WebCore {
-SVGRectTearOff::SVGRectTearOff(PassRefPtr<SVGRect> target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName)
- : NewSVGPropertyTearOff<SVGRect>(target, contextElement, propertyIsAnimVal, attributeName)
+SVGPointTearOff::SVGPointTearOff(PassRefPtr<SVGPoint> target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName)
+ : NewSVGPropertyTearOff<SVGPoint>(target, contextElement, propertyIsAnimVal, attributeName)
{
ScriptWrappable::init(this);
}
-void SVGRectTearOff::setX(float f, ExceptionState& exceptionState)
+void SVGPointTearOff::setX(float f, ExceptionState& exceptionState)
{
if (isImmutable()) {
exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
@@ -54,7 +55,7 @@ void SVGRectTearOff::setX(float f, ExceptionState& exceptionState)
commitChange();
}
-void SVGRectTearOff::setY(float f, ExceptionState& exceptionState)
+void SVGPointTearOff::setY(float f, ExceptionState& exceptionState)
{
if (isImmutable()) {
exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
@@ -65,26 +66,10 @@ void SVGRectTearOff::setY(float f, ExceptionState& exceptionState)
commitChange();
}
-void SVGRectTearOff::setWidth(float f, ExceptionState& exceptionState)
+PassRefPtr<SVGPointTearOff> SVGPointTearOff::matrixTransform(SVGMatrix matrix)
{
- if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
- return;
- }
-
- target()->setWidth(f);
- commitChange();
-}
-
-void SVGRectTearOff::setHeight(float f, ExceptionState& exceptionState)
-{
- if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
- return;
- }
-
- target()->setHeight(f);
- commitChange();
+ FloatPoint point = target()->matrixTransform(matrix);
+ return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnimVal);
}
}
« no previous file with comments | « Source/core/svg/SVGPointTearOff.h ('k') | Source/core/svg/SVGPolyElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698