Bug 12267

Summary: getElementById broken for <use>
Product: WebKit Reporter: Kyle Rove <kyle.rove>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: jay
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.sensoryoutput.com/external/freshview_week.svg
Attachments:
Description Flags
<use> breaks scripting
none
works if <use> not in script none

Kyle Rove
Reported 2007-01-14 11:18:12 PST
Summary: This SVG document has JavaScript to show more information when the mouse is over a data point, manipulating the visibility property of specific elements in the SVG document. This script works in Adobe SVG plugin and Firefox 2. Steps to reproduce: Go to http://www.sensoryoutput.com/external/freshview_week.svg and hover cursor over a data point. Expected results: Box with text about data node should appear. Actual results: No box with text about data node appears. To my knowledge, this has never worked in the SVG implementation of WebKit.
Attachments
<use> breaks scripting (1.17 KB, image/svg-xml)
2007-02-06 02:29 PST, jay
no flags
works if <use> not in script (1.11 KB, image/svg-xml)
2007-02-06 02:31 PST, jay
no flags
Eric Seidel (no email)
Comment 1 2007-01-14 21:05:47 PST
It's getting a null value here: tooltip.setAttributeNS(null,"transform","translate("+(parseInt(label.getAttributeNS(null,"x"))-40)+","+(parseInt(label.getAttributeNS(null,"y"))-23)+")") in graph.js Not sure why yet.
Eric Seidel (no email)
Comment 2 2007-01-14 21:17:17 PST
It turns out that: cible.getAttribute("id") returns "undefined" Not sure why yet.
Eric Seidel (no email)
Comment 3 2007-01-14 23:18:36 PST
It looks like this is actually a problem with <use>. Changing title accordingly.
Nikolas Zimmermann
Comment 4 2007-02-02 11:17:25 PST
(In reply to comment #3) > It looks like this is actually a problem with <use>. Changing title > accordingly. > Hmm it also doesn't work in Opera/Batik. Opera silently fails, Batik displays "Can not convert to null value". WebKit says "(event handler):Value undefined (result of expression cible.getAttribute) is not object.". Please provide a reduced testcase, what's really going on there. Greetings, Niko
Kyle Rove
Comment 5 2007-02-03 07:30:57 PST
This now works in ToT.
jay
Comment 6 2007-02-06 02:29:57 PST
Created attachment 12963 [details] <use> breaks scripting
jay
Comment 7 2007-02-06 02:31:46 PST
Created attachment 12964 [details] works if <use> not in script
jay
Comment 8 2007-02-06 02:36:04 PST
#6 reduced testcase: demonstrates that including <use> breaks scripting all 3 boxes visible, they should be hidden. #7 reduced testcase: as #6 but excluding reference to <use> works 2 boxes hidden, third <use> box wasn't scripted to be hidden
jay
Comment 9 2007-02-06 02:46:06 PST
suggest changing Summary to: getElementById broken for <use> and removing Keywords: NeedsReduction awaiting editbugs
jay
Comment 10 2007-02-06 02:50:48 PST
suggest changing Summary to: getElementById broken for <use> and removing Keywords: NeedsReduction awaiting editbugs
Nikolas Zimmermann
Comment 11 2007-02-28 08:41:32 PST
Okay, I finally found out what's going on here. The freshview_week.svg is broken and relies on bugs in the other SVG implementations. graph.js expects the "cible" to be of type SVGUseElement, though the SVG spec clearly says that the events should be dispatched to the corresponding SVGElementInstance and NOT the SVGUseElement. Easy fix to get it working in Safari: function path_show(evt) { cible = evt.target.correspondingUseElement ... instead of "cible = evt.target" So this is definately a "won't fix" bug. Though the reduction in #6 / #7 highlights a different bug, keeping this bug open. Niko
jay
Comment 12 2007-02-28 11:44:01 PST
#11 Nikolas, should I open a separate bug? ie for #6 & #7
Nikolas Zimmermann
Comment 13 2007-03-01 03:00:07 PST
(In reply to comment #12) > #11 > > Nikolas, should I open a separate bug? > ie for #6 & #7 > Hey Jay, i don't think that's needed. I plan to open a master bug anyway which should fix all currently reported <use> problems. I'll mark this bug and others (12926, 12916, 12917) as duplicates of the new master bug. Stay tuned :-) Niko
Nikolas Zimmermann
Comment 14 2007-03-01 10:05:43 PST
*** This bug has been marked as a duplicate of 12936 ***
Note You need to log in before you can comment on or make changes to this bug.