Parsing svg file with IE9 (OMSVGParser.parse())

235 views
Skip to first unread message

dislodrum

unread,
Jul 31, 2012, 8:30:48 AM7/31/12
to lib-g...@googlegroups.com
Hello,

I'm new in this forum so first of all, I'd like to say thanks for this librairy which works pretty good.

My problem is: I want to  parse an existing svg file from my java code.
Here are some pieces of code to explain what I did:

public void saveSvg() {
          String svgCode = mySvg.getMarkup();
          // Here I save the String into a svg file and it works
}

public void loadSvg() {
          String svgCodeToLoad = ... // Here, I load the code from the svg file saved before and it works

          OMSVGDocument doc = OMSVGParser.currentDocument();
  OMSVGSVGElement svgToLoad = doc.createSVGSVGElement();
   svgToLoad  = OMSVGParser.parse(svgCodeToLoad);
}

On Firefox, it works perfectly but on IE9, it crashes the browser !!
I don't get any error or exception.

Please, help !
Thank you in advance !

Dislodrum

Lukas Laag

unread,
Aug 20, 2012, 3:53:23 AM8/20/12
to lib-g...@googlegroups.com
Hi,
Sorry for the delayed response, I was on vacation in a remote location
without computers.
Regarding your issue, can you give more details, notably:
+ does IE crash on any SVG or just a specific one (can you provide an
SVG to reproduce the problem ?)
+ can you confirm the crash happens in web mode, not in dev mode (dev
mode on IE does not work I do not know why exactly but web mode
works).
+ Have you specified the HTML5 doctype in your GWT html file ?

Normally your use case is something which is supported. You can look
at the sample lib-gwt-svg web app
(http://www.vectomatic.org/gwt/lib-gwt-svg-samples-latest/lib-gwt-svg-samples.html),
in the parser section, you have demo and code for the feature.

Lukas

Raymond Loman

unread,
Jan 14, 2013, 9:04:38 AM1/14/13
to lib-g...@googlegroups.com
Hi Lukas,

At first thanks for your nice library. It works for the most except ...

I am getting the same error like Dislodrum above. In FF and Chrome it al works like a charm but in IE9 the browser crashes. To answer the questions you asked Dislodrum:
It appears the error occurs on (all) svg files which can't be parsed by the SVGParserImplIE (it crashes on the ModuleSpaceOOphm.doInvoke which call channel.invokeJS which results
in the crash.

The crash ONLY appears in Development mode and not in Web mode. Do you know when and why this happens?

And we are using the HTML5 doctype here (<!doctype html>)

Kindly awaiting your response (which may be in Dutch if you prefer! :-))


gr.
Raymond Loman


Op maandag 20 augustus 2012 09:53:23 UTC+2 schreef Lukas Laag het volgende:

Lukas Laag

unread,
Jan 15, 2013, 3:26:04 AM1/15/13
to lib-g...@googlegroups.com
Hi,

Thanks for the update, it contains the info I needed to reproduce (dev
mode, any call to OMSVGParser.parse() will reproduce the problem).
I will do my best to fix it, but don't expect too much: it might be a
problem with the dev plugin itself (as the problem does not happen in
web mode). Furthermore, the IE branch of the code is the most
complicated (because IE has no XPath support, so I need to emulate
them, plus there is a bug in IE when you have CSS in SVG).
As a general rule, I advise against using IE as anything but a porting
platform, it is an inferior product for GWT development compared to FF
and chromium. But maybe you have no choice and need to debug an
IE-specific issue.

Lukas

Raymond Loman

unread,
Jan 23, 2013, 10:57:06 AM1/23/13
to lib-g...@googlegroups.com
OK Lucas. I will wait for your reaction. Anyhow it appears only in devmode... 

Op dinsdag 15 januari 2013 09:26:04 UTC+1 schreef Lukas Laag het volgende:

Raymond Loman

unread,
Oct 8, 2013, 3:38:42 AM10/8/13
to lib-g...@googlegroups.com
Hi Lucas, 

Any progress on the below mentioned issue regarding the devmode in IE parsing SVG? 

Some other question. It appears there is a bug after Firefox 0.22 regarding the viewBox issue. There seems to be a development release waiting but there is no binaire code yet to download.
Any idea when this might be released? (I know this is not the right thread for this).

Kindly awaiting your response,

Raymond Loman
Carpago Software

Op dinsdag 31 juli 2012 14:30:48 UTC+2 schreef dislodrum:
Reply all
Reply to author
Forward
0 new messages