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

            webbuggrp Webbug Group created issue -
            pmangal Priyanka Mangal made changes -
            Field Original Value New Value
            Assignee Priyanka Mangal [ pmangal ]
            pmangal Priyanka Mangal made changes -
            Status New [ 10000 ] Open [ 1 ]
            pmangal Priyanka Mangal made changes -
            Labels regression webbug dcsprm regression webbug
            Hide
            pmangal Priyanka Mangal added a comment - - edited
            Issue reproducible in both windows 10 and Ubuntu 16.04.2 LTS.
            8u131, 8u152, 9-ea+170 => Fail
            Working fine in 8GA, 8u60, 8u121.
            Regression introduced in 8u131-b11.
            Show
            pmangal Priyanka Mangal added a comment - - edited Issue reproducible in both windows 10 and Ubuntu 16.04.2 LTS. 8u131, 8u152, 9-ea+170 => Fail Working fine in 8GA, 8u60, 8u121. Regression introduced in 8u131-b11.
            pmangal Priyanka Mangal made changes -
            Labels dcsprm regression webbug dcsprm regression reproducer-yes webbug
            pmangal Priyanka Mangal made changes -
            Attachment WebView131Test.java [ 70209 ]
            pmangal Priyanka Mangal made changes -
            OS other [ 17019 ] generic [ 17010 ]
            pmangal Priyanka Mangal made changes -
            CPU x86 [ 17004 ] generic [ 17008 ]
            pmangal Priyanka Mangal made changes -
            Affects Version/s 9 [ 16400 ]
            pmangal Priyanka Mangal made changes -
            Assignee Priyanka Mangal [ pmangal ]
            pmangal Priyanka Mangal made changes -
            Project Java Incidents [ 10301 ] JDK [ 10100 ]
            Key JI-9049218 JDK-8180825
            Workflow JBS Incident Workflow [ 4942755 ] JBS Workflow [ 4942755 ]
            Component/s javafx [ 11900 ]
            Component/s javafx [ 11901 ]
            Affects Version/s 8u131 [ 18707 ]
            Affects Version/s 9 [ 14949 ]
            Affects Version/s 9 [ 16400 ]
            Affects Version/s 8u131 [ 18703 ]
            Introduced In Version 8u131 [ 18707 ]
            pmangal Priyanka Mangal made changes -
            Subcomponent web [ 1406 ] web [ 1389 ]
            pmangal Priyanka Mangal made changes -
            Status Open [ 1 ] New [ 10000 ]
            Hide
            pmangal Priyanka Mangal added a comment -
            Seems duplicate of JDK-8143604, which was closed as Closed as Cannot Reproduce
            Show
            pmangal Priyanka Mangal added a comment - Seems duplicate of JDK-8143604 , which was closed as Closed as Cannot Reproduce
            pmangal Priyanka Mangal made changes -
            Link This issue duplicates JDK-8143604 [ JDK-8143604 ]
            pmangal Priyanka Mangal made changes -
            Link This issue duplicates JDK-8088852 [ JDK-8088852 ]
            vdyakov Victor Dyakov made changes -
            Assignee Guru Hb [ ghb ]
            Hide
            kcr Kevin Rushforth added a comment -
            I can reproduce this in jdk-9+170 and 8u131 using HelloWebView:

            $ java -cp apps/toys/Hello/dist/Hello.jar hello.HelloWebView https://mozilla.github.io/pdf.js/web/viewer.html

            As noted above it works fine in 8u121.
            Show
            kcr Kevin Rushforth added a comment - I can reproduce this in jdk-9+170 and 8u131 using HelloWebView: $ java -cp apps/toys/Hello/dist/Hello.jar hello.HelloWebView https://mozilla.github.io/pdf.js/web/viewer.html As noted above it works fine in 8u121.
            kcr Kevin Rushforth made changes -
            Summary Javafx WebView regression JavaFX WebView fails to display pdf.js
            kcr Kevin Rushforth made changes -
            Summary JavaFX WebView fails to display pdf.js JavaFX WebView fails to display pdf.js viewer
            mbilla Murali Billa made changes -
            Assignee Guru Hb [ ghb ] Murali Billa [ mbilla ]
            kcr Kevin Rushforth made changes -
            Priority P3 [ 3 ] P2 [ 2 ]
            mbilla Murali Billa made changes -
            Status New [ 10000 ] Open [ 1 ]
            Hide
            kcr Kevin Rushforth added a comment -
            This seems a serious regression, so raising the priority to P2.
            Show
            kcr Kevin Rushforth added a comment - This seems a serious regression, so raising the priority to P2.
            mbilla Murali Billa made changes -
            Fix Version/s 10 [ 16302 ]
            mbilla Murali Billa made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            vdyakov Victor Dyakov made changes -
            Fix Version/s 9 [ 14949 ]
            Fix Version/s 10 [ 16302 ]
            ghb Guru Hb made changes -
            Summary JavaFX WebView fails to display pdf.js viewer Javafx WebView fails to render pdf.js
            ghb Guru Hb made changes -
            Fix Version/s 10 [ 16302 ]
            Fix Version/s 9 [ 14949 ]
            ghb Guru Hb made changes -
            Fix Version/s 9 [ 14949 ]
            Fix Version/s 10 [ 16302 ]
            mbilla Murali Billa made changes -
            Attachment MiniBrowser_Screenshot.png [ 70314 ]
            vdyakov Victor Dyakov made changes -
            Due Date 2017-06-09
            vdyakov Victor Dyakov made changes -
            Due Date 2017-06-09 2017-06-16
            Hide
            arajkumar Arunprasad Rajkumar added a comment - - edited
            Problem is introduced after changeset r196954[1] which has partial implementation(only accepts URI) for FontFace loading API. pdf.js uses font face APIs with ArrayBuffer to load embedded fonts with in a PDF document. ArrayBuffer based font-face is supported after r200921[2].

            I have cheery-picked r200921[2] and tested with our WebKit port, I could load https://mozilla.github.io/pdf.js/web/viewer.html.

            webrev: http://cr.openjdk.java.net/~arajkumar/8180825/webrev

            [1] https://trac.webkit.org/changeset/196954/webkit
            [2] https://trac.webkit.org/changeset/200921/webkit
            Show
            arajkumar Arunprasad Rajkumar added a comment - - edited Problem is introduced after changeset r196954[1] which has partial implementation(only accepts URI) for FontFace loading API. pdf.js uses font face APIs with ArrayBuffer to load embedded fonts with in a PDF document. ArrayBuffer based font-face is supported after r200921[2]. I have cheery-picked r200921[2] and tested with our WebKit port, I could load https://mozilla.github.io/pdf.js/web/viewer.html . webrev: http://cr.openjdk.java.net/~arajkumar/8180825/webrev [1] https://trac.webkit.org/changeset/196954/webkit [2] https://trac.webkit.org/changeset/200921/webkit
            arajkumar Arunprasad Rajkumar made changes -
            Assignee Murali Billa [ mbilla ] Arunprasad Rajkumar [ arajkumar ]
            arajkumar Arunprasad Rajkumar made changes -
            Labels dcsprm regression reproducer-yes webbug dcsprm regression reproducer-yes review-requested webbug
            arajkumar Arunprasad Rajkumar made changes -
            Labels dcsprm regression reproducer-yes review-requested webbug dcsprm noreg-other regression reproducer-yes review-requested webbug
            Hide
            kcr Kevin Rushforth added a comment -
            The fix looks fine to me, and I tested it on Mac. I recommend that a test be provided (automated if possible).
            Show
            kcr Kevin Rushforth added a comment - The fix looks fine to me, and I tested it on Mac. I recommend that a test be provided (automated if possible).
            Hide
            ghb Guru Hb added a comment -
            +1
            Show
            ghb Guru Hb added a comment - +1
            Hide
            arajkumar Arunprasad Rajkumar added a comment - - edited
            Thanks [~kcr] , [~ghb].

            Incorporated [~kcr]'s review comment in http://cr.openjdk.java.net/~arajkumar/8180825/webrev.01
            (Added an automated test based on DRT test case found in https://trac.webkit.org/changeset/200921/webkit)

            Please take a look.
            Show
            arajkumar Arunprasad Rajkumar added a comment - - edited Thanks [~kcr] , [~ghb]. Incorporated [~kcr]'s review comment in http://cr.openjdk.java.net/~arajkumar/8180825/webrev.01 (Added an automated test based on DRT test case found in https://trac.webkit.org/changeset/200921/webkit) Please take a look.
            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]
            arajkumar Arunprasad Rajkumar made changes -
            Labels dcsprm noreg-other regression reproducer-yes review-requested webbug dcsprm jdk9-fix-request noreg-other regression reproducer-yes review-requested webbug
            vdyakov Victor Dyakov made changes -
            Labels dcsprm jdk9-fix-request noreg-other regression reproducer-yes review-requested webbug 8-bp dcsprm jdk9-fix-request noreg-other regression reproducer-yes review-requested webbug
            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
            arajkumar Arunprasad Rajkumar made changes -
            Labels 8-bp dcsprm jdk9-fix-request noreg-other regression reproducer-yes review-requested webbug 8-bp dcsprm jdk9-fix-request noreg-other regression reproducer-yes webbug
            kcr Kevin Rushforth made changes -
            Labels 8-bp dcsprm jdk9-fix-request noreg-other regression reproducer-yes webbug 8-bp dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug
            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
            arajkumar Arunprasad Rajkumar made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            pmangal Priyanka Mangal made changes -
            Link This issue relates to JDK-8182150 [ JDK-8182150 ]
            arajkumar Arunprasad Rajkumar made changes -
            Link This issue backported by JDK-8182277 [ JDK-8182277 ]
            ghb Guru Hb made changes -
            Labels 8-bp dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug 8-bp CPU17_04-critical-watch dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug
            ghb Guru Hb made changes -
            Labels 8-bp CPU17_04-critical-watch dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug 8-bp CPU17_04-critical-request dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug
            pmohan Praveen Mohan made changes -
            Labels 8-bp CPU17_04-critical-request dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug 8-bp CPU17_04-critical-SQE-OK CPU17_04-critical-request dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug
            ydagra Yashi Dagra made changes -
            Labels 8-bp CPU17_04-critical-SQE-OK CPU17_04-critical-request dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug 8-bp CPU17_04-critical-SQE-OK CPU17_04-critical-approved dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug
            prr Philip Race made changes -
            Link This issue backported by JDK-8184395 [ JDK-8184395 ]
            dbuck David Buck made changes -
            Labels 8-bp CPU17_04-critical-SQE-OK CPU17_04-critical-approved dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug CPU17_04-critical-SQE-OK CPU17_04-critical-approved dcsprm jdk9-fix-request jdk9-fix-yes noreg-other regression reproducer-yes webbug
            ghb Guru Hb made changes -
            Link This issue relates to JDK-8187344 [ JDK-8187344 ]

              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: