+2009-01-26 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22650
+ Implement support for "Immutable" attribute to CodeGeneratorJS.pm, thus
+ allowing to explicitly mark methods as immutable (i.e. returning a new
+ instance rather than a reference to an existing instance).
+
+ * bindings/js/JSSVGMatrixCustom.cpp: Removed custom methods.
+ * bindings/scripts/CodeGeneratorJS.pm: Added check for Immutable
+ attribute when generating function call.
+ * svg/SVGMatrix.idl: Replaced Custom attribute with Immutable on
+ methods.
+
2009-01-26 David Hyatt <hyatt@apple.com>
Eliminate isInlineFlow() now that a RenderBlock can never be an inline flow. isInlineFlow() is now
namespace WebCore {
-JSValuePtr JSSVGMatrix::multiply(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- TransformationMatrix secondMatrix = toSVGMatrix(args.at(exec, 0));
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.multiply(secondMatrix)).get(), m_context.get());
-}
-
JSValuePtr JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
{
TransformationMatrix imp(*impl());
return result;
}
-JSValuePtr JSSVGMatrix::translate(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- float x = args.at(exec, 0).toFloat(exec);
- float y = args.at(exec, 1).toFloat(exec);
-
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.translate(x, y)).get(), m_context.get());
-}
-
-JSValuePtr JSSVGMatrix::scale(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- float scaleFactor = args.at(exec, 0).toFloat(exec);
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.scale(scaleFactor)).get(), m_context.get());
-}
-
-JSValuePtr JSSVGMatrix::scaleNonUniform(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- float scaleFactorX = args.at(exec, 0).toFloat(exec);
- float scaleFactorY = args.at(exec, 1).toFloat(exec);
-
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.scaleNonUniform(scaleFactorX, scaleFactorY)).get(), m_context.get());
-}
-
-JSValuePtr JSSVGMatrix::rotate(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- float angle = args.at(exec, 0).toFloat(exec);
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.rotate(angle)).get(), m_context.get());
-}
-
JSValuePtr JSSVGMatrix::rotateFromVector(ExecState* exec, const ArgList& args)
{
TransformationMatrix imp(*impl());
return result;
}
-JSValuePtr JSSVGMatrix::flipX(ExecState* exec, const ArgList&)
-{
- TransformationMatrix imp(*impl());
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.flipX()).get(), m_context.get());
-}
-
-JSValuePtr JSSVGMatrix::flipY(ExecState* exec, const ArgList&)
-{
- TransformationMatrix imp(*impl());
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.flipY()).get(), m_context.get());
-}
-
-JSValuePtr JSSVGMatrix::skewX(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- float angle = args.at(exec, 0).toFloat(exec);
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.skewX(angle)).get(), m_context.get());
-}
-
-JSValuePtr JSSVGMatrix::skewY(ExecState* exec, const ArgList& args)
-{
- TransformationMatrix imp(*impl());
-
- float angle = args.at(exec, 0).toFloat(exec);
- return toJS(exec, JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.skewY(angle)).get(), m_context.get());
-}
-
}
#endif // ENABLE(SVG)
attribute double e;
attribute double f;
- [Custom] SVGMatrix multiply(in SVGMatrix secondMatrix);
+ [Immutable] SVGMatrix multiply(in SVGMatrix secondMatrix);
[Custom] SVGMatrix inverse()
raises(SVGException);
- [Custom] SVGMatrix translate(in float x, in float y);
- [Custom] SVGMatrix scale(in float scaleFactor);
- [Custom] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY);
- [Custom] SVGMatrix rotate(in float angle);
+ [Immutable] SVGMatrix translate(in float x, in float y);
+ [Immutable] SVGMatrix scale(in float scaleFactor);
+ [Immutable] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY);
+ [Immutable] SVGMatrix rotate(in float angle);
[Custom] SVGMatrix rotateFromVector(in float x, in float y)
raises(SVGException);
- [Custom] SVGMatrix flipX();
- [Custom] SVGMatrix flipY();
- [Custom] SVGMatrix skewX(in float angle);
- [Custom] SVGMatrix skewY(in float angle);
+ [Immutable] SVGMatrix flipX();
+ [Immutable] SVGMatrix flipY();
+ [Immutable] SVGMatrix skewX(in float angle);
+ [Immutable] SVGMatrix skewY(in float angle);
};
}