lewisje / svgweb

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

Object loaded svg with scripts not firing window load or SVGLoad event #499

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run tests/browser-tests/tests_js2.html on firefox, safari, both native
and flash and IE flash 

What is the expected output? What do you see instead?
You see assertion error "Subscribing to window.onload and _then_ SVG Webs
onload should work from inside embed2"

You should see "All tests passed"

The root problem is that neither addEventListener("load", ...) nor
addEventListener("SVGLoad") works inside the object loaded SVG.

Original issue reported on code.google.com by grick23@gmail.com on 30 May 2010 at 1:29

GoogleCodeExporter commented 8 years ago
Fixed in r1146:
Fix problem with addEventListener for load events on flash handler object 
_SVGWindow
fake object.

Also, fix this for native handler. Firefox does not appear to populate
SVGDocument.readyState, so we call the listener immediately.

This may not be technically correct. However, if addEventListener is being 
called on
the patched window, then the svg script code is already running and so the svg
document is probably ready enough to fire the load event. In practice, this 
appears
to be the case. Moreover, calling the listener even if the document is not fully
ready is better than the current behavior of never firing the event at all.

Original comment by grick23@gmail.com on 30 May 2010 at 1:51