RESOLVED FIXED 17736
JS (SVG) POD Type bindings bug
https://bugs.webkit.org/show_bug.cgi?id=17736
Summary JS (SVG) POD Type bindings bug
Nikolas Zimmermann
Reported 2008-03-09 19:19:31 PDT
As the summary says I found a pretty harsh JS POD type bindings bug, while writing tests for SVGLinearGradientElement & updating of the gradientTransform attribute. Try in trunk: var transform = mySVGSVGElement.createSVGTransform(); alert(transform.matrix.a); returns '1.0' as expected transform.matrix.a = 2; alert(transform.matrix.a); returns '1.0' :( Another way to trigger the bug without having to create a new SVGTransform object: myLinearGradientElement.gradientTransform.baseVal.getItem(0).matrix.a = 2; alert(myLinearGradientElement.gradientTransform.baseVal.getItem(0).matrix.a); returns '1.0' The problem is that we forgot to handle the case where a JSSVGPODTypeWrapper is able to create JSSVGPODTypeWrappers itself. In our case 'SVGTransform' contains 'readonly attribute SVGMatrix matrix;". As SVGTransform & SVGMatrix are both POD types our updating logic fails. It only works for SVG elements containing POD types (ie. a SVGRectElement contains a SVG(Animated)Length POD type => when modifying the POD Type the SVGRectElement gets updated correctly.) Not yet sure about possible solutions, still investigating.
Attachments
Layout test demonstrating this bug (1.13 KB, image/svg+xml)
2008-03-11 13:08 PDT, Jonathan Haas
no flags
Layout test for this bug (2.67 KB, patch)
2008-03-13 16:18 PDT, Jonathan Haas
no flags
Initial patch (23.28 KB, patch)
2008-08-03 12:53 PDT, Nikolas Zimmermann
koivisto: review+
Jonathan Haas
Comment 1 2008-03-11 13:08:38 PDT
Created attachment 19676 [details] Layout test demonstrating this bug Repro code from the bug repackaged as a layout test
Jonathan Haas
Comment 2 2008-03-13 16:18:12 PDT
Created attachment 19746 [details] Layout test for this bug eseidel introduced me to the wonders of the JavaScript layout test framework, so I reworked this test to use it. Added expected results, too, and formatted as a patch.
Nikolas Zimmermann
Comment 3 2008-08-03 12:27:28 PDT
Eek, fixed this bug a while ago. Forgot to submit the actual patch. Going to attach it soon.
Nikolas Zimmermann
Comment 4 2008-08-03 12:53:22 PDT
Created attachment 22626 [details] Initial patch Fixes all problem with POD types containing POD types.
Oliver Hunt
Comment 5 2008-08-11 17:54:15 PDT
I think antti should review this.
Antti Koivisto
Comment 6 2008-08-11 18:40:17 PDT
Comment on attachment 22626 [details] Initial patch Please add a test for the Immutable marker, otherwise r=me
Nikolas Zimmermann
Comment 7 2008-08-11 19:23:43 PDT
Landed in r35674, with a new test 'immutable-properties' which tests all cases of the new 'Immutable' IDL flag.
Note You need to log in before you can comment on or make changes to this bug.