Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8141399

javafx webview ReferenceError: Can't find variable with JDK 8 u60

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 8u60
    • 8u60
    • javafx
    • web
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.08.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft windows [version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      I've been attempting to use JavaFX's WebView and WebEngine elements to load My local html page. It's works fine with 1.8 u50,but when I update the jdk to 1.8 u60,I got this error: "ReferenceError: Can't find variable:" .

      I have found a same issue on the internet.

      http://www.jotform.com/answers/670475-Unable-to-load-Submissions-Page-due-to-JavaScript-Errors-when-Using-JavaFX-WebView-and-WebEngine/?entrymessage=10732640770

      So ,I wonder if it's the jdk1.8 u60's bug?

      I load my html file with webview :
      WD_webView.getEngine().load(this.getClass().getResource("html/my.html").toExternalForm());

      and the html is like this:

      <!doctype html>
      <html>
      <head>
      <title>CodeMirror: merge view demo</title>
      <meta charset="utf-8"/>
        <link rel=stylesheet href="../css/docs.css">
        <link rel=stylesheet href="../css/codemirror.css">
        <link rel=stylesheet href="../css/merge.css">
        <script src="../js/codemirror.js"></script>
        <script src="../js/diff_match_patch.js"></script>
        <script src="../js/merge.js"></script>

        <script src="../js/mode/clike.js"></script>
      </head>
      <body>
      <div id=view></div>

      <script type="text/javascript">
      var value, orig1, orig2, dv, panes = 2, highlight = true, connect = null, collapse = false;
      function initUI() {
      if (value == null)
      return;
      var target = document.getElementById("view");
      target.innerHTML = "";
      dv = CodeMirror.MergeView(target, {
      value : orig1,
      origLeft : panes == 3 ? orig1 : null,
      orig : orig2,
      lineNumbers : true,
      mode : "text/xsrc-c",
      highlightDifferences : highlight,
      connect : connect,
      collapseIdentical : collapse,
      revertButtons : false,
      readOnly : true
      });
      }

      window.onload = function() {
      value = document.documentElement.innerHTML;
      orig1 = "test ";
      orig2 = "test2";
      initUI();
      };
      </script>
      </body>
      </html>


      the jses and csses are put in the relative directorys.


      REGRESSION. Last worked in version 8u60

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.08.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      use jdk1.8 u50 webview load html ,js(CodeMirror) wroks fine;
      use jdk1.8 u50 webview load html ,get ReferenceError: Can't find variable: CodeMirror.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      ReferenceError: Can't find variable: CodeMirror.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      use webview load local html file:

      WD_webView.getEngine().load(this.getClass().getResource("html/my.html").toExternalForm());

      html file:

      <!doctype html>
      <html>
      <head>
      <title>CodeMirror: merge view demo</title>
      <meta charset="utf-8"/>
        <link rel=stylesheet href="../css/docs.css">
        <link rel=stylesheet href="../css/codemirror.css">
        <link rel=stylesheet href="../css/merge.css">
        <script src="../js/codemirror.js"></script>
        <script src="../js/diff_match_patch.js"></script>
        <script src="../js/merge.js"></script>

        <script src="../js/mode/clike.js"></script>
      </head>
      <body>
      <div id=view></div>

      <script type="text/javascript">
      var value, orig1, orig2, dv, panes = 2, highlight = true, connect = null, collapse = false;
      function initUI() {
      if (value == null)
      return;
      var target = document.getElementById("view");
      target.innerHTML = "";
      dv = CodeMirror.MergeView(target, {
      value : orig1,
      origLeft : panes == 3 ? orig1 : null,
      orig : orig2,
      lineNumbers : true,
      mode : "text/xsrc-c",
      highlightDifferences : highlight,
      connect : connect,
      collapseIdentical : collapse,
      revertButtons : false,
      readOnly : true
      });
      }

      window.onload = function() {
      value = document.documentElement.innerHTML;
      orig1 = "test ";
      orig2 = "test2";
      initUI();
      };
      </script>
      </body>
      </html>

      html Directory:

      --js
         |_codemirror.js
         |_diff_match_patch.js
         |_merge.js
         |_mode
            |_clike.js
      --html
         |_my.html
      --css
         |_codemirror.css
         |_merge.css
         |_docs.css
      ---------- END SOURCE ----------

        1. J8141399.java
          0.8 kB
        2. win7_not_repro.png
          win7_not_repro.png
          69 kB
        3. win7_not_repro.png
          win7_not_repro.png
          63 kB

            ghb Guru Hb (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: