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

WebView/WebEngine unable to render HTML5/JS charts

XMLWordPrintable

    • web

        I've run into an issue rendering some HTML/JS charts in the WebView.
         
        Here is the page I am testing with:
        http://d20pro.com/cfi/testRemote.html
         
        It loads fine in FireFox and I also installed WebKit/Safari and tested it works in that browser. However when loading this page with WebEngine, only some of the chart renders and the console is spammed with these two runtime exceptions:
        java.lang.IllegalArgumentException: dash lengths all zero
                  at com.sun.prism.BasicStroke.set(BasicStroke.java:123)
                  at com.sun.prism.BasicStroke.<init>(BasicStroke.java:58)
                  at com.sun.javafx.webkit.prism.WCStrokeImpl.getPlatformStroke(WCStrokeImpl.java:36)
                  at com.sun.javafx.webkit.prism.WCGraphicsPrismContext$15.doPaint(WCGraphicsPrismContext.java:1481)
                  at com.sun.javafx.webkit.prism.WCGraphicsPrismContext$Composite.paint(WCGraphicsPrismContext.java:1288)
                  at com.sun.javafx.webkit.prism.WCGraphicsPrismContext$Composite.paint(WCGraphicsPrismContext.java:1273)
                  at com.sun.javafx.webkit.prism.WCGraphicsPrismContext.strokePath(WCGraphicsPrismContext.java:1478)
                  at com.sun.webkit.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:260)
                  at com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:74)
                  at com.sun.webkit.WebPage.paint2GC(WebPage.java:738)
                  at com.sun.webkit.WebPage.paint(WebPage.java:705)
                  at com.sun.javafx.sg.prism.NGWebView.renderContent(NGWebView.java:70)
                  ...
        java.lang.IllegalStateException: Unbalanced saveState/restoreState
                  at com.sun.javafx.webkit.prism.WCGraphicsPrismContext.dispose(WCGraphicsPrismContext.java:1545)
                  at com.sun.javafx.webkit.prism.WCPageBackBufferImpl.disposeGraphics(WCPageBackBufferImpl.java:33)
                  at com.sun.webkit.WebPage.paint(WebPage.java:707)
                  at com.sun.javafx.sg.prism.NGWebView.renderContent(NGWebView.java:70)
                  ...
         
        The AMCharts library seems to work fine with the WebView in general, as demonstrated by this URL: http://www.amcharts.com/javascript-products/
         
        The testRemote.html is structured in a different way, with the chart inside a form. There isn't anything wrong with the HTML or JavaScript on this page though (as far as my team can tell). Could it be a corner-case bug in Prism?

              loneid Leonid Popov (Inactive)
              mmortonjfx Mat Morton (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported: