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

WebView horizontal scrolling using mouse or touch device causes rendering artifacts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u20, 8u40
    • javafx
    • web

        If you create a simple webview and display any web page in it scrolling to the right or left will cause the rendering to be corrupt.

        Use a touch device and pan around or use your middle mouse button on the desktop and make sure you can make the scrollbar go left and right. On a touch device this makes the Webview unusable for pages that are wider than the view.

        Example code to replicate this:

        <code>

        package sample;

        import javafx.application.Application;
        import javafx.scene.Parent;
        import javafx.scene.Scene;
        import javafx.scene.layout.BorderPane;
        import javafx.scene.web.WebView;
        import javafx.stage.Stage;

        public class Demo extends Application {

            @Override
            public void start(Stage primaryStage) throws Exception {

                Parent root = new BorderPane();
                primaryStage.setTitle("WebView Test");
                primaryStage.setScene(new Scene(root, 500, 500));

                BorderPane borderPane = (BorderPane) root;
                final WebView webView = new WebView();
                borderPane.setCenter(webView);
                webView.getEngine().load("https://www.google.co.uk/search?q=test");

                primaryStage.show();
                webView.getEngine().setJavaScriptEnabled(true);

            }


            public static void main(String[] args) {
                launch(args);
            }
        }

        </code>

              anashaty Anton Nashatyrev (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported: