Closed Bug 732367 Opened 12 years ago Closed 12 years ago

getElementById() for an SVG tag fails in 1 scope, works in another.

Categories

(Core :: SVG, defect)

10 Branch
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 280391

People

(Reporter: junkmail_2010, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120216080748

Steps to reproduce:

Environment: Ubuntu 10.4, Firefox 10.0.2 

Basically, I am trying to play with svgs using  javascript. I took 2 slightly different ways to approach the problem:

1) Used and .svg file: (Please take a look at attached svgTesterScriptWithinSvg.svg file) I created an svg file and embedded javascript code inside svg. 

2) Used an HTML file: (Please see attached svgTesterWorksOnOperaButNotInFirefox.html file) I created an HTML file, slapped that svg and javascript code inside HTML and gave it a go. 




Actual results:

Case 1:  Things seem to be OK here.  I could do whatever I wanted to do. I confirmed that this works just fine in both firefox and opera.  Firefox is doing what it is supposed to do, perfectly fine.

Case 2:  Here I found out that getElementById() on svg tag is unimplemented. It works just fine in Opera



Expected results:

I think case 1 is an OK situation.

for case 2 on the other hand, there is a very slight change the way I accessed the svg component in the document. Honestly, my knowledge on either javascript or svg that deep, so, I am not clear if case 1 is exactly the same as case 2 in terms of accessing svg component. Assuming, no matter how we get the svg component in the DOM, firing up getElementById() on that node should be the same. However obviously my assumption is not right.


I am really not sure if this is a bug or not, as firefox doesn't crush or anything like that. It gracefully says that it is an unimplemented feature. I am just puzzled to see that same behavior works within SVG file. 

Cheers,
Should be fixed in Fx11.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Component: Untriaged → SVG
Product: Firefox → Core
QA Contact: untriaged → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: