Menu

#1465 Javascript Raphael not found error

Latest SVN
closed
None
1
2016-05-19
2012-12-05
traveler
No

net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "Raphael" is not defined. (http://www.delta.com/dlhome/N976272180/shared/jawr/js/core_apps.js#315)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3651)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3714)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1759)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.name(ScriptRuntime.java:1698)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1767)
at script(http://www.delta.com/dlhome/N976272180/shared/jawr/js/core_apps.js:315)
at script(http://www.delta.com/dlhome/N976272180/shared/jawr/js/core_apps.js:315)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)

Discussion

  • Ahmed Ashour

    Ahmed Ashour - 2012-12-07
    • status: open --> pending
    • assigned_to: Ahmed Ashour
     
  • Marc Guillemot

    Marc Guillemot - 2013-01-24
     
  • Marc Guillemot

    Marc Guillemot - 2013-01-24

    @traveler
    can you test with a recent snapshot. I've improved HtmlUnit to avoid failures with Raphael and (at least while simulating FF) it is now able to load the 28 demo pages from Raphael website.

     
  • Frank Danek

    Frank Danek - 2013-01-25

    We had the same issue as described by traveler. One of our sites (Atlassian JIRA) uses Raphael and we where not able to even open the page.

    Using the latest snapshot from your CruiseControl server (24/01/2013 13:04:51 (build.2230)) opening the page was possible as FF3.6. So I can confirm that your fix works there.

    But the problem still exists for IE, so I started a little analysis. The problem here is a completely different. Raphael is a JS library to generate SVG graphics. This is a good idea in FF but the IE does not support SVG. So Raphael tries to find out if SVG is supported. This check works correct for FF (supports SVG) and IE (does not support SVG) in HtmlUnit.
    If SVG is not supported (IE) Raphael wants to use VML and tests if it is supported. This test does not work in HtmlUnit IE as in real IE and the result is that VML is not supported which leads to an abortion of the initialization of Raphael, esp. window.Raphael is not set. This results in the described 'undefined' error when trying to access this variable, which is correct because it really is undefined. It is just not what the IE is doing there...

    Some Raphael code snippets:
    Test for SVG support

    R.type = (g.win.SVGAngle || g.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML");

    Works for FF (SVG) and IE (VML)!

    Test for VML support

    if (R.type == "VML") {
    var d = g.doc.createElement("div"),
    b;
    d.innerHTML = '<v:shape adj="1">';
    b = d.firstChild;
    b.style.behavior = "url(#default#VML)";
    if (!(b && typeof b.adj == "object")) {
    return (R.type = E);
    }
    d = null;
    }
    </v:shape>

    Does not work (for IE).
    b is set and of type [object]. (ok)
    typeof b.adj is string instead of object.

     
  • RBRi

    RBRi - 2016-05-19

    IE 11 (the one we are currently simulating) supports SVG; VML was gone with IE10.
    Additionally i have checked some demos. Looks like the problem is gone now.

     
  • RBRi

    RBRi - 2016-05-19
    • status: pending --> closed
     

Log in to post a comment.

Auth0 Logo