Commit c72ee774 authored by dglazkov@chromium.org's avatar dglazkov@chromium.org

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 415d8de4
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
......@@ -16692,6 +16692,9 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = NO;
};
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
......@@ -29,14 +29,6 @@ using namespace JSC;
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());
......@@ -48,42 +40,6 @@ JSValuePtr JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
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());
......@@ -99,34 +55,6 @@ JSValuePtr JSSVGMatrix::rotateFromVector(ExecState* exec, const ArgList& args)
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)
......@@ -1531,7 +1531,9 @@ sub GenerateImplementationFunctionCall()
push(@implContent, "\n" . $indent . "JSC::JSValuePtr result = " . NativeToJSValue($function->signature, 1, $implClassName, "", $functionString, "castedThisObj") . ";\n");
push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions};
if ($podType) {
if ($podType and not $function->signature->extendedAttributes->{"Immutable"}) {
# Immutable methods do not commit changes back to the instance, thus producing
# a new instance rather than mutating existing one.
push(@implContent, $indent . "wrapper->commitChange(imp, castedThisObj->context());\n");
}
......
......@@ -34,19 +34,19 @@ module 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);
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment