mustang2247 / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

getElementsByTagNameNS(svgns, 'svg')[0] fails in IE7 #424

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by bradbur...@gmail.com on 23 Nov 2009 at 9:27

Attachments:

GoogleCodeExporter commented 8 years ago
I'm also experiencing this in IE8, win xp, with Gelatinous-Cube flash-version: 
10,0,42,34

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

if (ns == svgns && localName == 'svg') {
  results.push(this.rootElement._getProxyNode());
}

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 
failure.

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.

Original comment by atsolb...@gmail.com on 12 Feb 2010 at 5:22

GoogleCodeExporter commented 8 years ago
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).

Original comment by bradneub...@gmail.com on 12 Feb 2010 at 7:23

GoogleCodeExporter commented 8 years ago
Yes I have one svg element inside the main svg element. Btw, the error was 
"object does 
not support this method or property".

Original comment by atsolb...@gmail.com on 12 Feb 2010 at 8:03

GoogleCodeExporter commented 8 years ago
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.

Original comment by bradneub...@gmail.com on 12 Feb 2010 at 8:38

GoogleCodeExporter commented 8 years ago
Circles become red: 

In the function getElementsByTagNameNS there is a line
    results.push(this.rootElement._getProxyNode())

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. 

Original comment by geert.va...@macqel.eu on 10 Mar 2010 at 3:07

GoogleCodeExporter commented 8 years ago

Original comment by bradneub...@gmail.com on 15 Mar 2010 at 6:32

GoogleCodeExporter commented 8 years ago
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. :-) 

[1] http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-536297177
[2] https://developer.mozilla.org/en/The_DOM_and_JavaScript#Explanations
[3]
https://developer.mozilla.org/en/Gecko_DOM_Reference/Introduction#Important_Data
_Types

Original comment by helder.magalhaes on 2 Apr 2010 at 1:39

GoogleCodeExporter commented 8 years ago
Actually Helder, accessing elements in a NodeList using square bracket notation 
IS
part of the DOM standard.  Go to
http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html and search for 
"square
bracket notation".

Note that this technique is not supported by the Adobe SVG Viewer

Original comment by codedr...@gmail.com on 2 Apr 2010 at 1:46

GoogleCodeExporter commented 8 years ago
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. ;-)

Original comment by helder.magalhaes on 4 Apr 2010 at 11:33

GoogleCodeExporter commented 8 years ago
Unit tests for this in tests/browser-tests/issue-tests/issue424.html

Original comment by bradneub...@gmail.com on 8 Apr 2010 at 10:14

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1099.

Original comment by bradneub...@gmail.com on 8 Apr 2010 at 10:21