MRchildNEO / svgweb

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

'this._svgObjects is null or not an object' in ie8 w/ only dynamically inserted <object>s #563

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've got a page that uses _only_ dynamically inserted SVG <object>s.  It works 
fine everywhere but IE, but in IE8 (haven't tried 6 or 7 yet) the first 
svgweb.appendChild() call crashes with "this._svgObjects is null or not an 
object" in the devtools console.  The insertion is happening from inside the 
onsvgload handler.

Original issue reported on code.google.com by zack.weinberg on 28 Oct 2010 at 4:03

GoogleCodeExporter commented 8 years ago
Do you have a simplified test case we can use for testing?

Original comment by bradneub...@gmail.com on 16 Nov 2010 at 10:14

GoogleCodeExporter commented 8 years ago
Not presently.  Please remind me if I haven't put one together by December 1.

Original comment by zack.weinberg on 16 Nov 2010 at 10:21

GoogleCodeExporter commented 8 years ago
Zack- Last call for an example. Closing soon. Thanks.

Original comment by grick23@gmail.com on 30 Dec 2010 at 8:42

GoogleCodeExporter commented 8 years ago
I need till next week but will get something to you as quick as possible.

Original comment by zack.weinberg on 30 Dec 2010 at 9:47

GoogleCodeExporter commented 8 years ago
I am unable to reproduce this bug with a small test case.  The project for 
which I needed SVGWeb is over, so I am not especially interested in trying to 
reassemble the (now long-discarded) code that originally triggered the bug and 
then minimize it.  Go ahead and close the bug, and if I see it again I'll file 
a new one.

Original comment by zack.weinberg on 10 Jan 2011 at 6:45

GoogleCodeExporter commented 8 years ago
I was about to create a new bug entitled "Removing dynamically added content 
fails when parts added as DocumentFragment.", but while working on detailing it 
very very clearly and going through and example that worked and did not work I 
found the issue. I have attached a bug.html file which is as simple as I could 
make it. I've also attached a nobug.html file to make it even clearer.

This may also relate to issue 637.

The manual suggests that the following two are alternatives:

// Must use a callback to know when SVG is appended to page (this is slight
// divergence from standard). The following are supported ways to do this:
svg.addEventListener('SVGLoad', function() {
  svg = this; // this will correctly refer to your SVG root
  alert('loaded!');
}, false);
// also supported:
svg.onsvgload = function() {
  alert('loaded!');
}

But if you use the "onsvgload" the removal will fail, whereas using the first 
syntax it does not fail.

The failure is reported (in WebKit) as follows:

TypeError: 'undefined' is not an object (evaluating 'nodeHandler._scriptNode')

... basically it iterates through something with some nulls in it.

That should/could solve this behaviour. And perhaps initiate a new bug on how 
to add things (or just remove the alternative syntax?).

Original comment by wilandl...@gmail.com on 30 May 2012 at 1:54

Attachments: