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

WebView, typing after loadContent-Method call causes disappearing text

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: openjfx11
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Subcomponent:
      web
    • CPU:
      x86_64
    • OS:
      linux

      Description

      ADDITIONAL SYSTEM INFORMATION :
      The bug was first noticed under Windows 10 then it could be reproduced under Linux Debian but not under Ubuntu 18.04.1

      A DESCRIPTION OF THE PROBLEM :
      Under the described conditions some of the last lines of the webview disappears each time a key is typed. After moving/resizing the stage the lost lines appears again inclusive the new typed characters. After that, the bug does not appears again.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Resize the webview so that the text is shown in a minimum number of lines (Debian: 5, Windows: 2) and last line is not full.
      2. Let the webview stage loose the focus.
      3. Focus the webview again, and set the cursor at the end of the content.
      4. Type any character.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The typed character is appended to the text in the webview.
      ACTUAL -
      The last few lines of the existing text in the webview are seemingly disappearing but if the content is printed it contains the whole correct text (including the appended new character). After repeated typing, the next few lines disappear and the actual content is now like the shown webview text after the first typing.

      ---------- BEGIN SOURCE ----------
      import com.sun.javafx.webkit.Accessor;
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.StackPane;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      public class JavaFXWebViewBug extends Application {

          @Override
          public void start(Stage primaryStage) {
              WebView webView = new WebView();
              webView.getEngine().loadContent("fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff fffff");
              Accessor.getPageFor(webView.getEngine()).setEditable(true);

              primaryStage.setScene(new Scene(new StackPane(webView), 150, 200));
              primaryStage.show();
          }

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

      CUSTOMER SUBMITTED WORKAROUND :
      (KeyListener that resizes the webview pane +/- 1px)

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              ghb Guru Hb
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: