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

Missing lines in rendering of KaTeX formulas

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • jfx11, 8u391, jfx17, jfx21, jfx22
    • javafx
    • Issue not reproducible in Linux- Ubuntu

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      JavaFX 21.0.1 (actually happens with all versions from at least Java 17 up), JDK versions 17 to 21 from different vendors (Oracle OpenJDK, Azul Zulu, Temurin)

      - Darwin MacBook-Pro 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

      - Windows 11 Pro (ARM 64)

      - Linux debian 6.1.0-13-arm64 #1 SMP Debian 6.1.55-1 (2023-09-29) aarch64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      When I open the attached file on my laptop with retina display, the fraction line is missing.

      I first observed this when JavaFX updated the WebKit version so I thought it was a WebKit bug and I raised an issue there (https://bugs.webkit.org/show_bug.cgi?id=207754). However the WebKit devs are unable to reproduce it in recent WebKit versions.

      To check whether this is rather a WebKit bug, I tested with Safari on MacOS and Gnome Web on debian, both use WebKit for rendering and show the fraction line both in Retina and non-Retina display modes.

      I tested with JavaFX 21.0.1 (and before that 17) WebKit on Windows, Linux, and MacOS and the fraction line is there in non-Retina mode but not in Retina mode.

      This worked in JavaFX 8.


      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the provided code on a machine with a Retina display.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The output should contain the user agent string and a rendering of the fraction 3/4.
      ACTUAL -
      The output should contain the user agent string and a rendering of the fraction 3/4 without the fraction line.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

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

          @Override
          public void start(Stage stage) {
              WebView webView = new WebView();
              webView.getEngine().loadContent("""
                      <!DOCTYPE html>
                      <html lang="en">
                          <head>
                              <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
                         \s
                              <!-- The loading of KaTeX is deferred to speed up page rendering -->
                              <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
                         \s
                              <!-- To automatically render math in text elements, include the auto-render extension: -->
                              <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
                                      onload="renderMathInElement(document.body);"> \s
                              </script>
                          </head>
                      <body onload="myRender()">
                      User Agent:<script>document.write(navigator.userAgent);</script><br>
                                      
                      Fraction 3/4:
                      \\[ \\frac{3}{4} \\]
                      </body>
                      </html>
                      """
              );
              stage.setScene(new Scene(webView, 300, 200));
              stage.show();
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always

        1. Capture_mac.png
          Capture_mac.png
          42 kB
        2. Capture_ubuntu.png
          Capture_ubuntu.png
          15 kB
        3. Capture_Windows.png
          Capture_Windows.png
          33 kB
        4. Main.java
          2 kB

            kcr Kevin Rushforth
            pnarayanaswa Praveen Narayanaswamy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: