DOMParser undefined issue in IE6/7/8

177 views
Skip to first unread message

Weihua

unread,
Apr 19, 2011, 9:59:47 AM4/19/11
to lib-gwt-svg
Hi Lukas,

I wander if you can fix the "DOMParser is undefined" issue in IE6/7/8.
For Windows users who still use these old-school browsers this is
really inconvenient, but I believe they account for majority of the PC
users.

If I understand correctly, the problem can be solved by change/ re-
write the following codes in the source file :
org.vectomatic.dom.svg.impl.SVGParserImpl.java:

--- code ---
private final JavaScriptObject domParser = createDOMParser();
private native JavaScriptObject createDOMParser() /*-{
return new DOMParser();
}-*/;

public final native Document parseFromString(String rawText, String
contentType) /*-{
return
this.@org.vectomatic.dom.svg.impl.SVGParserImpl::domParser.parseFromString(rawText,
contentType);
}-*/;
--- code ---

I think these codes can be easily replaced using native Java.

Thank you very much.

Weihua

Lukas Laag

unread,
Apr 19, 2011, 10:33:36 AM4/19/11
to lib-g...@googlegroups.com

Hi Weihua,

Alas, I do not think that supporting IE6/7/8 is as easy as fixing the
DOM parser issue (even if this is the first issue one runs into).
Indeed, there is no SVG engine in IE6/7/8 to begin with. Which means one
would have to integrate an external SVG engine based on something else
(like http://code.google.com/p/svgweb/ which is based on flash).

This is no easy feat as such engines are not drop-in replacements for
native SVG engines (you need to call a special javascript API here and
there to get the thing working, and there are usually limitations and
partial support for the SVG javascript API).

I had looked at svgweb a year ago and concluded that there were still
too many features missing to make the attempt to integrate it feasible.
They have had two releases since, so it would probably worthwhile to
re-evaluate it. I put that on my todo list

Lukas

Weihua

unread,
Apr 19, 2011, 11:01:18 AM4/19/11
to lib-gwt-svg
Hi Lukas,

thanks for your quick reply. I agree with you that DOMparser is
probably the first among a long list of issues to be solved in order
to support IE6/7/8. However it's worth the effort since these old IE
browsers are still dominating the market.

Although there is no build-in SVG engine in IE6/7/8, all features of
SVG can be supported by Adobe SVG viewer, of cause first of all you
have install this plugin.

Yes indeed SVGweb is based on flash, but it also support "native SVG
mode" that no flash is required (see their demo:
http://codinginparadise.org/projects/svgweb/samples/demo.html?name=photos&svg.render.forceflash=false).
Besides, there are other very good javascript libraries that support
native SVGs, for example 'Raphaël' (http://raphaeljs.com/); all its
examples run quite well on IE8.

Anyway, I hope these old IE browsers can be supported in the near
future.

Thanks.

Weihua

On Apr 19, 4:33 pm, Lukas Laag <laa...@gmail.com> wrote:
> On 04/19/2011 03:59 PM, Weihua wrote:
>
>
>
>
>
>
>
>
>
> > Hi Lukas,
>
> > I wander if you can fix the "DOMParser is undefined" issue in IE6/7/8.
> > For Windows users who still use these old-school browsers this is
> > really inconvenient, but I believe they account for majority of the PC
> > users.
>
> > If I understand correctly, the problem can be solved by change/ re-
> > write the following codes in the source file :
> > org.vectomatic.dom.svg.impl.SVGParserImpl.java:
>
> > --- code ---
> > private final JavaScriptObject domParser = createDOMParser();
> > private native JavaScriptObject createDOMParser() /*-{
> >      return new DOMParser();
> > }-*/;
>
> > public final native Document parseFromString(String rawText, String
> > contentType) /*-{
> >      return
> > th...@org.vectomatic.dom.svg.impl.SVGParserImpl::domParser.parseFromString(rawTe xt,
> > contentType);
> > }-*/;
> > --- code ---
>
> > I think these codes can be easily replaced using native Java.
>
> > Thank you very much.
>
> > Weihua
>
> Hi Weihua,
>
> Alas, I do not think that supporting IE6/7/8 is as easy as fixing the
> DOM parser issue (even if this is the first issue one runs into).
> Indeed, there is no SVG engine in IE6/7/8 to begin with. Which means one
> would have to integrate an external SVG engine based on something else
> (likehttp://code.google.com/p/svgweb/which is based on flash).

Tiago Cardoso

unread,
Apr 19, 2011, 11:24:44 AM4/19/11
to lib-g...@googlegroups.com
Hello Weihua,

Maybe I can add some information on this.

IE 6/7/8 doesn't have native support for SVG.
Native svg mode from SVGweb doens't work on IE.
Raphael library use VML on IE to work, not SVG.

Lib-gwt-svg uses the browser implementation of SVG to work. Is like a
wrapper (with a lot more).

To being able to support on IE, it had to use flash an SVGweb, but like
lukas wrote, there are a lot of - otherwise native SVG implementation
from the browser - fuctionality in SVGweb.

Lukas, if SVGweb already had that functionality by now, it would be
really great :)

So Weihua, there is no easy solution to implementing SVG on IE 8-
That has been a recuring problem on the web. TH newer IE are
implementing SVG, so that is great news.

Best regards,

Tiago Cardoso

Em 19-04-2011 16:01, Weihua escreveu:
> Hi Lukas,
>
> thanks for your quick reply. I agree with you that DOMparser is
> probably the first among a long list of issues to be solved in order
> to support IE6/7/8. However it's worth the effort since these old IE
> browsers are still dominating the market.
>
> Although there is no build-in SVG engine in IE6/7/8, all features of
> SVG can be supported by Adobe SVG viewer, of cause first of all you
> have install this plugin.
>
> Yes indeed SVGweb is based on flash, but it also support "native SVG
> mode" that no flash is required (see their demo:
> http://codinginparadise.org/projects/svgweb/samples/demo.html?name=photos&svg.render.forceflash=false).
> Besides, there are other very good javascript libraries that support

> native SVGs, for example 'Rapha�l' (http://raphaeljs.com/); all its

Reply all
Reply to author
Forward
0 new messages