Bug 11830 - JS SVG POD types do not work properly when being assigned
Summary: JS SVG POD types do not work properly when being assigned
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Critical
Assignee: Nikolas Zimmermann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-14 12:04 PST by Nikolas Zimmermann
Modified: 2006-12-14 12:55 PST (History)
0 users

See Also:


Attachments
Initial patch (31.18 KB, patch)
2006-12-14 12:13 PST, Nikolas Zimmermann
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.