My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 424: getElementsByTagNameNS(svgns, 'svg')[0] fails in IE7
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Apr 2010

Sign in to add a comment
Reported by, Nov 23, 2009
What steps will reproduce the problem?
In EBTN_Test.html, IE stops processing at the call to
getElementsByTagNameNS(svgns, 'svg')[0]. The circles should end up red but
remain empty.

What version of the product are you using? On what operating system,
browser, and version of Flash? Gelatinous-Cube, Windows XP, IE7, "10,0,32,18"

Please provide any additional information below. Reduced test cases are
always appreciated! In my original (not reduced) IE was actually producing
an error, however I couldn't seem to reproduce the error message with the
reduced case. The behaviour is the same however.

1.0 KB   View   Download
1.4 KB   View   Download
Feb 12, 2010
I'm also experiencing this in IE8, win xp, with Gelatinous-Cube flash-version: 

The problem seems to be on line 8522 ins svg.js

if (ns == svgns && localName == 'svg') {

In the [Methods] array on results I didn't see anything called 'push' in the IE8 
debugger, or _getProxyNode() on the rootElement but that may be just an IE8 debugger 

This is a problem for me since I have nested SVG elements, the inner one being a 
complicated table of data built with rect's and text elements.  I've mentioned before 
this works if I keep the nested svg element at the bottom of the dom so the rest of 
the elements in the dom structure aren't hosed.
Feb 12, 2010
Project Member #2
Do you mean you have nested <svg> elements inside other <svg> elements? We don't 
yet support that and its known to fail ( Issue 123 ).
Feb 12, 2010
Yes I have one svg element inside the main svg element. Btw, the error was "object does 
not support this method or property".
Feb 12, 2010
Project Member #4
Yeah, that's an artifact of how we do some of our magic on IE, including the fact that 
the code as it stands now assumes that the <svg> element is always the root, which 
 Issue 123  would address fixing.
Mar 10, 2010
Circles become red: 

In the function getElementsByTagNameNS there is a line

In the function _onRenderingFinished 
    doc.rootElement = root._getProxyNode(); 

when in the second the call to _getProxyNode() is erased, it works.
    doc.rootElement = root; 

I understand why there in one call to _getProxyNode() too many because the proxy node
itself has no  _getProxyNode() method.
However I do not yet understand why it must be the second call. When modified in
getElementsByTagNameNS is does not work.

Tested on Firefox and IE8

I don't think this is related to nested svg. 
Mar 15, 2010
Project Member #6
(No comment was entered for this change.)
Labels: Patch
Apr 2, 2010
#7 helder.magalhaes
Note that the array syntax, "getElementsByTagNameNS(svgns, 'svg')[0]", is not part of
the DOM standard [1]: it's a Mozilla et. al. JavaScript extension [2] [3] (sorry but
I wasn't able to find the page where this is clearly stated) to the standard, which
should be "getElementsByTagNameNS(svgns, 'svg').item(0)".

I didn't test if it that makes the issue go away but, if it does, I'd suggest mark
this invalid and simply improve documentation for the sake of evangelize things a
bit. :-) 

Apr 2, 2010
Actually Helder, accessing elements in a NodeList using square bracket notation IS
part of the DOM standard.  Go to and search for "square
bracket notation".

Note that this technique is not supported by the Adobe SVG Viewer
Apr 4, 2010
#9 helder.magalhaes
Thanks for clearing this up, Jeff! :-)

I guess this became a myth living in my head for a while already, probably due to
this ASV limitation. I'm convinced I've seen it in at least another implementation,
which has probably made the idea stronger, but I can't recall which one for sure
(Renesis or eSVG, maybe?). :-|

Sorry, everyone, for the noise. ;-)
Apr 8, 2010
Project Member #10
Unit tests for this in tests/browser-tests/issue-tests/ issue424 .html
Apr 8, 2010
Project Member #11
This issue was closed by revision r1099.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting