From d7ad8768b854f84535bf6f0da3c5affd1f0438e2 Mon Sep 17 00:00:00 2001 From: zimmermann Date: Mon, 19 Mar 2007 19:28:12 +0000 Subject: [PATCH] Reviewed by Maciej. Make JS function calls on POD-types (ie. SVGLength) take effect. Calling ie. newValueInSpecifiedUnits on SVGLength works as expected. This worked fine before we switched to SVGLength POD type, so this can be considered as P1 regression fix. Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString doesn't work as expected - needs a seperated fix. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20323 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 9 +++++++++ .../svg/hixie/dynamic/005-broken-expected.png | Bin 3250 -> 3261 bytes .../svg/hixie/dynamic/005-broken-expected.txt | 6 +++--- WebCore/ChangeLog | 16 ++++++++++++++++ WebCore/bindings/scripts/CodeGeneratorJS.pm | 10 +++++++--- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 13ad70c64986..9f1db4f99034 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2007-03-19 Nikolas Zimmermann + + Reviewed by Maciej. + + Partly fix svg/hixie/dynamic/005-broken.svg. Update test results. + + * svg/hixie/dynamic/005-broken-expected.png: + * svg/hixie/dynamic/005-broken-expected.txt: + 2007-03-19 Nikolas Zimmermann Reviewed by Maciej. diff --git a/LayoutTests/svg/hixie/dynamic/005-broken-expected.png b/LayoutTests/svg/hixie/dynamic/005-broken-expected.png index af4d896b5fa66a5db4c8d2fb81bc27ffbca239f2..371fe6660063b2951027bb52f5da25b7b870fad4 100644 GIT binary patch delta 128 zcmV-`0Du3o8NC^hBs7FcL_t(|obB1c4Z=_i1wjYVH*{`V;Iv;+W-53mODkXVogIK1 z*pG7s0C)E~Jpcdzcn-6H0SE&RnQLbD^ay}|>^fHfaCbhlp#cp83+BDMr#Aoq01x2< iv2g(gldu6F7Ul=uUk|3dv1aK20000i1B%QlYbs!1;HmUrXFZ2-+h5$A?wiBJ$^~t!W4EAB$vU_)z*@4ybL8a|4i+WMpDsNMYe%V3;7N zz`)?(HYzw8Aft(4G$V|b3?sT!oM*bZnwf#2fJ0t@fk8ppfq|i+hk=oS!H9{4f#C$l osNiUTj3$QBj4)azopr07qw+F#rGn diff --git a/LayoutTests/svg/hixie/dynamic/005-broken-expected.txt b/LayoutTests/svg/hixie/dynamic/005-broken-expected.txt index 0c3511b3b1cf..189aa7def6ac 100644 --- a/LayoutTests/svg/hixie/dynamic/005-broken-expected.txt +++ b/LayoutTests/svg/hixie/dynamic/005-broken-expected.txt @@ -1,6 +1,6 @@ layer at (0,0) size 800x600 RenderView at (0,0) size 800x600 - RenderSVGContainer {svg} at (0,0) size 150x300 + RenderSVGContainer {svg} at (0,0) size 300x300 RenderPath {rect} at (0,0) size 150x300 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L150.00,0.00L150.00,300.00L0.00,300.00"] - RenderPath {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#008000]}] [data=""] - RenderPath {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#000000]}] [data=""] + RenderPath {rect} at (0,0) size 300x150 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L300.00,0.00L300.00,150.00L0.00,150.00"] + RenderPath {rect} at (0,150) size 300x150 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,150.00L300.00,150.00L300.00,300.00L0.00,300.00"] diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 82cfc534b9ba..2f18188359ac 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2007-03-18 Nikolas Zimmermann + + Reviewed by Maciej. + + Make JS function calls on POD-types (ie. SVGLength) take effect. + Calling ie. newValueInSpecifiedUnits on SVGLength works as expected. + + This worked fine before we switched to SVGLength POD type, so this + can be considered as P1 regression fix. + + Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though + it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString + doesn't work as expected - needs a seperated fix. + + * bindings/scripts/CodeGeneratorJS.pm: + 2007-03-19 Adele Peterson Reviewed by Adam. diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm index 23b9ad399842..66e59b638d99 100644 --- a/WebCore/bindings/scripts/CodeGeneratorJS.pm +++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm @@ -992,7 +992,8 @@ sub GenerateImplementation push(@implContent, " return throwError(exec, TypeError);\n\n"); if ($podType) { - push(@implContent, " $podType& imp(*static_cast<$className*>(thisObj)->impl());\n\n"); + push(@implContent, " JSSVGPODTypeWrapper<$podType>* wrapper = static_cast<$className*>(thisObj)->impl();\n"); + push(@implContent, " $podType& imp(*wrapper);\n\n"); } else { push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(static_cast<$className*>(thisObj)->impl());\n\n"); } @@ -1030,7 +1031,7 @@ sub GenerateImplementation if ($hasOptionalArguments) { push(@implContent, " if (argsCount < " . ($paramIndex + 1) . ") {\n"); - GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 3); + GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 3, $podType); push(@implContent, " }\n\n"); } @@ -1071,7 +1072,7 @@ sub GenerateImplementation } push(@implContent, "\n"); - GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2); + GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType); push(@implContent, " }\n"); # end case } @@ -1146,6 +1147,7 @@ sub GenerateImplementationFunctionCall() my $functionString = shift; my $paramIndex = shift; my $indent = shift; + my $podType = shift; if (@{$function->raisesExceptions}) { $functionString .= ", " if $paramIndex; @@ -1156,10 +1158,12 @@ sub GenerateImplementationFunctionCall() if ($function->signature->type eq "void") { push(@implContent, $indent . "$functionString;\n"); push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; + push(@implContent, $indent . "wrapper->commitChange(exec);\n") if $podType; push(@implContent, $indent . "return jsUndefined();\n"); } else { push(@implContent, "\n" . $indent . "KJS::JSValue* result = " . NativeToJSValue($function->signature, "", $functionString) . ";\n"); push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions}; + push(@implContent, $indent . "wrapper->commitChange(exec);\n") if $podType; push(@implContent, $indent . "return result;\n"); } } -- 2.36.0