DOMParser is undefined solution

943 views
Skip to first unread message

Basti

unread,
Sep 16, 2010, 2:52:12 PM9/16/10
to lib-gwt-svg
Hello Lucas,

I don't know why but I just now found out that I cannot use lib-gwt-
svg with IE7 / IE8 due to the "DOMParser is undefined" exception.

You create the DOMParser in
"org.vectomatic.dom.svg.impl.SVGParserImpl" via JSNI. Wouldn't a
simple if condition do the trick as proposed in
http://www.w3schools.com/xml/tryit.asp?filename=tryxml_parsertest2 ?

regards
Sebastian

Lukas Laag

unread,
Sep 16, 2010, 3:49:41 PM9/16/10
to lib-gwt-svg
You are right from a DOM/XML point of view. However IE7/IE8 do not
implement SVG at all, so even if you could create the proper XML tags,
IE7/8 would not know what to do with it. However things are going to
change in a big way with IE9. MS seems to have a very decent SVG
implementation (with hardware acceleration), though not 100% complete
(no filters, no animation yet). I played with it yesterday and there
seems to be everything which is required to port lib-gwt-svg on this
platform. MS seems to have fixed most of the weird incompatibilities
and unimplemented APIs they used in IE to cripple the web (there is
DOMParser, DOM Level 2 support, ...). I plan to provide IE9 support
soon, as soon as the GWT team begins providing some support for it.
You can follow their progress here

http://code.google.com/p/google-web-toolkit/issues/detail?id=5125

Cheers,

Lukas

Basti

unread,
Sep 17, 2010, 5:26:39 AM9/17/10
to lib-gwt-svg
thats reasonable! But I thought there are svg plugins available for
the IE. People who are developing intranet applications with you lib,
can expect from their users to install such a plugin, if they don't
want to use an alternative browser. If it could be fixed, at least
partially, by means of a simple if-condition, I think the lib could be
used more frequently.

kind regards :)
Sebastian

Lukas Laag

unread,
Sep 17, 2010, 5:56:34 AM9/17/10
to lib-g...@googlegroups.com
There used to be an SVG plugin made by Adobe a long time ago but they have discontinued it to promote Flash. The other candidate is a project called svgweb, which is very interesting, but too incomplete at the moment to support lib-gwt-svg. It is an SVG implementation based on Flash. I started a prototype based on this project but could not go very far. I am monitoring their progress though.

Basti

unread,
Sep 17, 2010, 1:27:06 PM9/17/10
to lib-gwt-svg
I've just installed the IE9 beta. It can render .svg files, but it
doesn't know the DOMParser yet. :/

Lukas Laag

unread,
Sep 17, 2010, 4:38:28 PM9/17/10
to lib-gwt-svg
Actually, it does. They have provided a sample to demonstrate it:

http://ie.microsoft.com/testdrive/HTML5/DOMParserXMLSerializer/Default.html

The key seems to be the doctype. If you use the HTML5 doctype (<!
DOCTYPE html>), you enter a clean mode where life is more
beautiful ;-). If you use another doctype, you stay in classic IE
quirks mode.

Lukas

Basti

unread,
Sep 20, 2010, 9:38:14 AM9/20/10
to lib-gwt-svg
mhh it's quite surprising how simple the new html 5 header is. But lib-
gwt-svg still doesn't work with IE in my try-outs. Do you wait for
Google when GWT supports the IE 9?

Cheers
Sebastian

Lukas Laag

unread,
Sep 21, 2010, 5:18:19 AM9/21/10
to lib-gwt-svg
I know lib-gwt-svg currently does not work with IE9. Indeed I am
waiting for a move from GWT dev team. If GWT itself does not work or
only partially works, there is no need to rush to provide lib-gwt-svg.
But as soon as the GWT team begins to provide support, lib-gwt-svg on
IE9 will be the first item on my todo list.
Reply all
Reply to author
Forward
0 new messages