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

Javafx WebView fails to render pdf.js

    Details

    • Subcomponent:
      web
    • Introduced In Version:
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_131"
        Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
        Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [version 6.3.9600]

        A DESCRIPTION OF THE PROBLEM :
        Webview of javafx v1.8.0_131 isn't able to display demo page of pdf.js ("https://mozilla.github.io/pdf.js/web/viewer.html").

        This works in previous versions of java.

        REGRESSION. Last worked in version 8u112


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        //import com.mohamnag.fxwebview_debugger.DevToolsDebuggerServer;

        import javafx.application.Application;
        import javafx.scene.Scene;
        import javafx.scene.web.WebEngine;
        import javafx.scene.web.WebView;
        import javafx.stage.Stage;

        public class WebView131Test extends Application
        {
        public static void main(String[] args)
        {
        launch(args);
        }

        @Override
        public void start(Stage primaryStage) throws Exception
        {
        WebView browser = new WebView();
        WebEngine webEngine = browser.getEngine();
        webEngine.setOnError(event -> System.err.println(event.getMessage()));
        webEngine.setOnAlert(event -> System.err.println(event.getData()));

        webEngine.setJavaScriptEnabled(true);
        webEngine.load("https://mozilla.github.io/pdf.js/web/viewer.html");

        Scene scene = new Scene(browser);
        primaryStage.setScene(scene);

        primaryStage.show();

        // try{
        // DevToolsDebuggerServer.startDebugServer(webEngine.impl_getDebugger(), 51742);
        // }
        // catch(Exception e){
        // e.printStackTrace();
        // }
        // primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
        // @Override
        // public void handle(WindowEvent event){
        // try{
        // DevToolsDebuggerServer.stopDebugServer();
        // }
        // catch(Exception e){
        // e.printStackTrace();
        // }
        // }
        // });

        }

        }

        ---------- END SOURCE ----------

        1. WebView131Test.java
          1 kB
          Priyanka Mangal
        1. MiniBrowser_Screenshot.png
          1.23 MB

          Issue Links

            Activity

            Hide
            arajkumar Arunprasad Rajkumar added a comment -
            Fix Request

            a) Why it's important to fix this bug:
            This bug is a regression after new WebKit upgrade (JDK-8166999), it breaks few customer applications.

            b) Explain the nature of fix:
            Existing font-face API in our WebKit port is incomplete and it supports webfont resource as URL only, but pdf.js uses font-face API with ArrayBuffer/ArrayBufferView which is supported only after r200921. It is a direct merge from upstream WebKit.

            c) Estimate its risk:
            This is low risk fix, it just enables applications to pass ArrayBuffer/ArrayBufferView as an argument to FontFace API

            d) Describe its test coverage:
            Unit test case added under MiscellaneousTest based on DRT test case present in r200921, it loads ttf file and converts it to ArrayBuffer. Once the ttf font is loaded using FontFace API, various states are tested including it's text rendering.

            e) Reviewer:
            [~kcr], [~ghb] and [~mbilla]
            Show
            arajkumar Arunprasad Rajkumar added a comment - Fix Request a) Why it's important to fix this bug: This bug is a regression after new WebKit upgrade ( JDK-8166999 ), it breaks few customer applications. b) Explain the nature of fix: Existing font-face API in our WebKit port is incomplete and it supports webfont resource as URL only, but pdf.js uses font-face API with ArrayBuffer/ArrayBufferView which is supported only after r200921. It is a direct merge from upstream WebKit. c) Estimate its risk: This is low risk fix, it just enables applications to pass ArrayBuffer/ArrayBufferView as an argument to FontFace API d) Describe its test coverage: Unit test case added under MiscellaneousTest based on DRT test case present in r200921, it loads ttf file and converts it to ArrayBuffer. Once the ttf font is loaded using FontFace API, various states are tested including it's text rendering. e) Reviewer: [~kcr], [~ghb] and [~mbilla]
            Hide
            kcr Kevin Rushforth added a comment -
            Looks good to me.

            +1
            Show
            kcr Kevin Rushforth added a comment - Looks good to me. +1
            Hide
            mbilla Murali Billa added a comment - - edited
            Tested the fix..Looks fine..
            +1
            Show
            mbilla Murali Billa added a comment - - edited Tested the fix..Looks fine.. +1
            Hide
            kcr Kevin Rushforth added a comment -
            Fix request approved

            Approved to push to FX 9-dev for JDK 9.
            Show
            kcr Kevin Rushforth added a comment - Fix request approved Approved to push to FX 9-dev for JDK 9.
            Hide
            arajkumar Arunprasad Rajkumar added a comment -
            changeset: c458f0ceb559
            user: arajkumar
            date: Mon Jun 12 22:58:51 2017 +0530
            description: 8180825: Javafx WebView fails to render pdf.js
            Reviewed-by: kcr, ghb, mbilla
            URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/c458f0ceb559
            Show
            arajkumar Arunprasad Rajkumar added a comment - changeset: c458f0ceb559 user: arajkumar date: Mon Jun 12 22:58:51 2017 +0530 description: 8180825: Javafx WebView fails to render pdf.js Reviewed-by: kcr, ghb, mbilla URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/c458f0ceb559

              People

              • Assignee:
                arajkumar Arunprasad Rajkumar
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: