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

Underline and line-through not straight in WebView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx19
    • jfx17, jfx19
    • javafx
    • web
    • x86_64
    • windows_10

        When a text is underlined or striked in a WebView (or HTMLEditor), the line is not straight and is slightly falling down.

        Step to reproduce:
        Run this code:
        "import javafx.application.Application;
        import javafx.scene.Scene;
        import javafx.scene.layout.StackPane;
        import javafx.scene.web.WebEngine;
        import javafx.scene.web.WebView;
        import javafx.stage.Stage;

        public class LoadHtml extends Application {

            public void start(Stage primaryStage) throws Exception {
                primaryStage.setTitle(System.getProperty("java.runtime.version"));

                WebView browser = new WebView();
                WebEngine engine = browser.getEngine();

                engine.loadContent("<div style=\"font-size:36pt; font-family:Arial; text-decoration: underline; \">aaaaaaa aaaaaaaaaaaaaaaa</div>\n"
                        + "<div style=\"font-size:36pt; font-family:Arial; text-decoration: line-through;\">aaaaaaa aaaaaaaaaaaaaaa</div>");

                StackPane sp = new StackPane();
                sp.getChildren().add(browser);

                Scene scene = new Scene(sp);

                primaryStage.setScene(scene);
                primaryStage.show();
            }

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

        Actual result:
        See the capture where the line is slightly falling down.

        Expected result:
        The line should be straight.

          1. JDK17.png
            7 kB
            Samir Hadzic
          2. issue.png
            50 kB
            Jay Bhaskar

              jbhaskar Jay Bhaskar
              shadzic Samir Hadzic
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: