Bug 14150

Summary: SVG DOM is broken in fundamental ways
Product: WebKit Reporter: Nikolas Zimmermann <zimmermann>
Component: SVGAssignee: Eric Seidel (no email) <eric>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 15395    
Attachments:
Description Flags
Fix (and formal application for my 1337 template hacker merit badge)
zimmermann: review+
test case none

Nikolas Zimmermann
Reported 2007-06-14 16:03:30 PDT
try: alert(myRect.x == myRect.x) :-) snippet from JSSVGRectElement: JSValue* JSSVGRectElement::getValueProperty(ExecState* exec, int token) const { SVGRectElement* imp = static_cast<SVGRectElement*>(impl()); switch (token) { case XAttrNum: { ASSERT(exec && exec->dynamicInterpreter()); RefPtr<SVGAnimatedLength> obj = imp->xAnimated(); .... snippet from SVGElement.h: PassRefPtr<ClassName::SVGAnimatedTemplate##UpperProperty> ClassName::LowerProperty##Animated() const \ { \ return RefPtr<ClassName::SVGAnimatedTemplate##UpperProperty>(new ClassName::SVGAnimatedTemplate##UpperProperty(this)); \ } It's pretty clear that the SVG DOM semantics are broken w/o this. Need to discuss with Eric, and come up with yet another caching solution. Bug 13963 fixes similar problems for JSSVGLength - same fixes are needed for JSSVGAnimatedLength. Once that patch is landed, this already works: var one = myRect.x.baseVal; var two = myRect.x.baseVal; one.value = 100; two.value = 200; and one.value == two.value returns true. Similar fix is needed for the JSSVGAnimated* classes. Will be fun :-)
Attachments
Fix (and formal application for my 1337 template hacker merit badge) (10.95 KB, patch)
2007-10-11 00:13 PDT, Eric Seidel (no email)
zimmermann: review+
test case (1.79 KB, application/xhtml+xml)
2007-10-11 01:30 PDT, Eric Seidel (no email)
no flags
Nikolas Zimmermann
Comment 1 2007-06-14 16:16:07 PDT
In case anyone wonders if we were smoking crack because no one ever noticed that before: Visually everything works - there are no crashes etc. It only breaks if you're making assumptions about the SVG DOM itself! I think Antoine reported similar stuff.
Eric Seidel (no email)
Comment 2 2007-10-11 00:13:47 PDT
Created attachment 16623 [details] Fix (and formal application for my 1337 template hacker merit badge)
Eric Seidel (no email)
Comment 3 2007-10-11 01:30:06 PDT
Created attachment 16625 [details] test case
Nikolas Zimmermann
Comment 4 2007-10-11 03:40:51 PDT
Comment on attachment 16623 [details] Fix (and formal application for my 1337 template hacker merit badge) Yay! Excellent work Eric - this was on my TODO list way too long :-) Finally it's fixed, r=me.
Eric Seidel (no email)
Comment 5 2007-10-11 07:42:05 PDT
Landed on feature-branch as r26357.
Note You need to log in before you can comment on or make changes to this bug.