[webkit-dev] SVGMatrix and AffineTransform

Nikolas Zimmermann zimmermann at kde.org
Wed Dec 6 15:16:00 PST 2006

Am Dienstag, 5. Dezember 2006 20:15 schrieb Darin Adler:
> I'd like to see us do the same thing with SVGMatrix and
> AffineTransform that we did with SVGRect and FloatRect. We could use
> AffineTransform in the SVG DOM implementation, and have SVGMatrix be
> part of the bindings.
> Do others think that's a good idea?
Heya Darin,

I have all of them on my TODO list, I'm currently sitting on a large
patch which removes the SVGLength ptr usage within ksvg2/.

Replacing SVGMatrix is the next step.
Though we need to solve several JS wrapper issues first:
- POD type generation has to be supported by the CodeGeneratorJS.pm
   (otherwhise we'll have to duplicate implementations like JSSVGPoint/Rect
    in every binding (objc, js, ...) )

Current implementation is not quite correct yet. Stuff like
"document.rootElement.viewBox.baseVal.value = 100;"
won't work at the moment.

"viewBox" returns a "SVGAnimatedRect", and baseVal returns
a FloatRect, which is wrapped by a JSSVGRect object.
Though that objects stores a local FloatRect member variable.
So modifying wouldn't at all change the svg element's viewBox, as expected.

This problem is specific to SVGPoint/SVGRect/SVGNumber, the only
POD-types in the SVG JS DOM we have. For all other objects there is no
problem, as the generated ones operatore on refcounted impl pointers....

Still thinking about an elegant solution to this problem.
If anyone has ideas, please speak up :-)


More information about the webkit-dev mailing list