Bug 11830

Summary: JS SVG POD types do not work properly when being assigned
Product: WebKit Reporter: Nikolas Zimmermann <zimmermann>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Critical    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Initial patch darin: review+

Description Nikolas Zimmermann 2006-12-14 12:04:42 PST
All SVG pod type wrappers have problems, with putValueProperty(). The property modification
actually works inside JSSVGPoint/JSSVGRect though only acting on a copy of the actual variable
stored in the JSSVGPoint/JSSVGRect object.

if you write ie. "document.rootElement.width.baseVal.value = 100" the value is only updated
in the wrappers (aka. document.rootElement.width.baseVal.value _is_ 100 afterwards) but
the SVGSVGElement doesn't notice this. If we'd store pointers in the JS SVG wrappers it would
work, but that would require passing FloatPoint/FloatRect pointers around everywhere in ksvg2/.
No one wants this, so we need another solution specificially for the auto-generated wrappers.

Attaching patch for this soon (I've worked two weeks to find a solution :-)
Comment 1 Nikolas Zimmermann 2006-12-14 12:13:11 PST
Created attachment 11841 [details]
Initial patch

No new regressions, none fixed. Can't create a LayoutTest for this, as things only break, if you apply my SVGLength* -> SVGLength patch and do NOT have this patch yet.
Comment 2 Darin Adler 2006-12-14 12:22:04 PST
Comment on attachment 11841 [details]
Initial patch

I think there's some const missing here. Since SVGMatrix is immutable, I think the AffineTransform inside an SVGMatrix should be const.

Regardless, r=me
Comment 3 Nikolas Zimmermann 2006-12-14 12:39:36 PST
(In reply to comment #2)
> (From update of attachment 11841 [details] [edit])
> I think there's some const missing here. Since SVGMatrix is immutable, I think
> the AffineTransform inside an SVGMatrix should be const.
> 
> Regardless, r=me

Thanks a lot for the quick review!
You mean in JSSVGMatrixCustom.cpp, regarding the const?

Niko

Comment 4 Nikolas Zimmermann 2006-12-14 12:55:40 PST
Landed in r18217. Also found & fixed the const issue mentioned by Darin.