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

WebView displays plain text in italics instead of normal style

    Details

    • Subcomponent:
      web
    • CPU:
      x86_64
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_172-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_172-ea-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 25.172-b03, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      macOS 10.12.6

      A DESCRIPTION OF THE PROBLEM :
      When loading a simple web page like this into a WebView, the text is displayed in italics instead of normal:

      <html>
      <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      </head>
      <body>
      <p>Test</p>
      </body>
      </html>

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just create a WebView and load the HTML page mentioned above into it on MacOS.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The text should be displayed normal, without any formatting, like in Safari or Google Chrome.
      ACTUAL -
      The text is displayed in Italics.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      webView.getEngine().load(getClass().getResource("test.html").toString());

      Where test.html is this:

      <html>
      <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      </head>
      <body>
      <p>Test</p>
      </body>
      </html>
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      A workaround is to load a different font for "Lucida Grande" via CSS:

      @font-face {font-family: "Lucida Grande";src: url(<URL to Roboto.ttf>)}

        Attachments

        1. index_macOS.html
          0.1 kB
        2. ItalicTextInWebview.zip
          1 kB
        3. LoadHtml.java
          0.8 kB
        4. Screen Shot 2018-03-28 at 13.16.22.png
          Screen Shot 2018-03-28 at 13.16.22.png
          25 kB
        5. webview_macOS.png
          webview_macOS.png
          13 kB

          Activity

            People

            • Assignee:
              mbilla Murali Billa
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: