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

[Win10] JavaFX: WebView wrong rendering in High Contract Black theme

    Details

    • Subcomponent:
      web
    • CPU:
      generic
    • OS:
      windows_10

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_162-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_162-ea-b01)
      Java HotSpot(TM) Client VM (build 25.162-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.10586]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Java 8 update 152 + b161

      A DESCRIPTION OF THE PROBLEM :
      Wrong font + background colors in HTML's "<input controls" inside WebView (javaFX) with "High Contrast #1 or #2 or Black" Theme on Windows 10.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Hi JavaFX team,

      Steps to reproduce:
      1. Set "High Contrast Black / #1 / #2 as Theme on Windows 10
      2. Run JavaFX application - code provided below.
      3. See IE vs JavaFX WebView screenshots (https://ibb.co/hmNhnb)

      Main issue Black text on Black background - is not readeable.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Should be white (yellow) font on black background
      see https://ibb.co/hmNhnb for rendering in IE (or other browser).
      ACTUAL -
      black text with black background

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      /**
       * Title: <TBD>
       * Description: <TBD>
       * Copyright: Copyright (c) 2015+ Company: SAP SE
       *
       * @author Mykola Gorbarov (d043357)
       * @version 1.0
       */


      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.Region;
      import javafx.scene.paint.Color;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;


      public class HiContrastTest extends Application {
          private Scene scene;

          @Override
          public void start(Stage stage) {
              // create scene
              stage.setTitle("High Contrast Web View");
              scene = new Scene(new Browser(), 750, 500, Color.web("#666970"));
              stage.setScene(scene);
              // show stage
              stage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
      }
      class Browser extends Region {
          final WebView browser = new WebView();

          public Browser() {
              // load the home page
              browser.getEngine().loadContent("<html><head><!--740:U1Y --> <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"><meta http-equiv=\"content-style-type\" content=\"text/css\"><style> body{ background-color:#95B1C1; color:#000000; font-family:SansSerif,helvetica,sans-serif; font-size:9pt; } table{ font-family:SansSerif,helvetica,sans-serif; font-size:9pt; } table.dd{ border-width:2px; border-style:solid; border-collapse:collapse; border-color:#4F556A; }table.dd th{ border-width:1px; padding:2px; border-style:solid; background:#6780B8; color:#FFFFFF; } table.dd td{ border-width:1px; padding:2px; border-style:solid; } table.trans{ border-style:none } table.trans td{ border-style:none; padding:0 } table.trans table.dd table.trans td{ border-style:none; padding:0 } table.trans table.dd td{ border-style:solid; padding:2px; } button{ font-family:SansSerif,helvetica,sans-serif; font-size:9pt; background-color:#95B1C1; margin:0px; width:100%; cursor:pointer; height:20px; text-align:center; background-image:url(back.gif); padding-left:5px; padding-right:5px; border-left:1px solid gray; border-right:1px solid gray; border-top:0; border-bottom:0; } button span{ white-space:nowrap; vertical-align:top; } .imgButtonLabel{ padding-left:5px; } input{ font-family:SansSerif,helvetica,sans-serif; font-size:9pt; } select{ font-family:SansSerif,helvetica,sans-serif; font-size:9pt; } a{ text-decoration:none; color:#0063A4; } a:hover{ text-decoration:underline; } a:visited{ color:#666666; } .HEADING{ font-size:17pt; } .KEY{ background-color:#CDE8FB; } .SUCCESS{ background-color:#CEF8AE; } .WARNING{ background-color:#FDBCBC; } .HEADER1{ background:#6780B8; font-family:SansSerif,helvetica,sans-serif; color:#FFFFFF; } </style><script language=\"JavaScript\"> var enter_pressed = \" \"; function ButtonClick(form,button) { if(enter_pressed == \" \"){ fname=form.name; form.sapbu_cl.value=button.id; form.sapse_cl.value=\" \"; form.sapin_cl.value=\" \"; document[fname].submit();} else{enter_pressed = \" \"; } } function SelectChange(form,select) { fname=form.name; form.sapbu_cl.value=\" \"; form.sapse_cl.value=select.id; form.sapin_cl.value=\" \"; document[fname].submit();} function InputHelpF1(form,input) { fname=form.name; form.sapbu_cl.value=\" \"; form.sapse_cl.value=\" \"; form.sapin_cl.value=input.id + \"sapHELPF1\"; document[fname].submit();} function InputKeyDown(form,input) {form.sapbu_cl.value=\" \"; form.sapse_cl.value=\" \"; if(event.keyCode == 115) {form.sapin_cl.value=input.id+\"sapHELPF4\"; fname=form.name; document[fname].submit();} if(event.keyCode == 13 || event.keyCode == 10) { form.sapin_cl.value=input.id+\"sapENTER\"; enter_pressed=\"X\"; fname=form.name; document[fname].submit();} } function toggle(areaname) { target = document.all(areaname); if (target.style.display == \"none\") { target.style.display = \"\";} else { target.style.display = \"none\"; } } </script></head><body scroll=\"no\" topmargin=\"0\" leftmargin=\"0\"> <!%_BODYSTART> <DIV style=\"{ margin-top:5pt; margin-left:5pt }\"> <!%_A1F1!><form style=\"margin:1px\" name=\"A1F1\" method=\"post\" action=\"SAPEVENT:A1F1\"> <input type=\"hidden\" name=\"sapbu_cl\" value=\" \"><input type=\"hidden\" name=\"sapse_cl\" value=\" \"><input type=\"hidden\" name=\"sapin_cl\" value=\" \"> <!%_A1F1S1!><select id=\"A1F1S1NAME:TYPE_SELECTION\" name=\"A1F1S1\" tabindex=\"0\" style=\"display: \" onChange=\"SelectChange(this.form,this);\" title=\"Object&#x20;Category\"><option value=\"APH\" >Application&#x20;Hierarchy</option><option value=\"_QS\">Development&#x20;Object</option><option value=\"K\">Package</option><option value=\"P\">Program</option><option value=\"F\">Function&#x20;Group</option><option value=\"FF\">Function&#x20;Module</option><option value=\"O\" selected><!%!>Class&#x20;&#x2f;&#x20;Interface</option><option value=\"WS\">Internet&#x20;Service</option><option value=\"YC\">Web&#x20;Dynpro&#x20;Comp.&#x20;&#x2f;&#x20;Intf.</option><option value=\"WO\">BSP&#x20;Application</option><option value=\"WB\">BSP&#x20;Extension</option><option value=\"WIA\">Inactive&#x20;Objects</option><option value=\"&#x24;TM\">Local&#x20;Objects</option> </select><!%_A1F1S1!> <br><table class=\"trans\" cellspacing=\"0\" cellpadding=\"0\"><tr> <td> <input type=\"text\" id=\"A1F1I2NAME:TYPE_NAME\" name=\"A1F1I2\" size=35 maxlength=30 style=\"display: \" tabindex=\"0\" title=\"Object&#x20;Name\" value= \"CL_TREE_MODEL\" onHelp=\"InputHelpF1(this.form,this);\" onKeyDown=\"InputKeyDown(this.form,this);\"></td> <td><button id=\"A1F1B3NAME:BUTTON_F4\" type=\"button\" tabindex=\"0\" style=\"display: \" title=\"Input&#x20;help\" onClick=\"ButtonClick(A1F1,this);\" onKeypress=\"if(event.keycode=13) ButtonClick(A1F1,this);\"> <img src=\"s_b_prvi.gif\" alt=\" Input&#x20;help\" title=\" Input&#x20;help\" align=\"middle\"> </button></td> <td> <!%_A1F1S4!><select id=\"A1F1S4NAME:APPL_HIER_TYPE\" name=\"A1F1S4\" tabindex=\"0\" style=\"display:none\" onChange=\"SelectChange(this.form,this);\" title=\"Object&#x20;Name\"> <option value=\"WA\" selected><!%!></option> <option value=\"WO\">BSP&#x20;Applications</option> <option value=\"XD\">Business&#x20;Add-Ins&#x20;&#x28;Definition&#x29;</option> <option value=\"XI\">Business&#x20;Add-Ins&#x20;&#x28;Impl.&#x29;</option> <option value=\"O\">Class&#x20;&#x2f;&#x20;Interface</option> <option value=\"DE\">Data&#x20;Elements</option> <option value=\"DT\">Database&#x20;Tables</option> <option value=\"DD\">Domains</option> <option value=\"F\">Function&#x20;Groups</option> <option value=\"FF\">Function&#x20;Modules</option> <option value=\"K\">Packages</option> <option value=\"P\">Programs</option> <option value=\"DH\">Search&#x20;Helps</option> <option value=\"DS\">Structures</option> <option value=\"DA\">Table&#x20;Types</option> <option value=\"T\">Transactions</option> <option value=\"DV\">Views</option> </select><!%_A1F1S4!></td> <td><button id=\"A1F1B5NAME:BUTTON_SHOW\" type=\"button\" tabindex=\"0\" style=\"display: \" title=\"Display\" onClick=\"ButtonClick(A1F1,this);\" onKeypress=\"if(event.keycode=13) ButtonClick(A1F1,this);\"> <img src=\"s_b_disp.gif\" alt=\" Display\" title=\" Display\" align=\"middle\"> </button></td> </tr></table> <!%_CURSOR!><!A1F1> </form><!%_/A1F1!> </DIV> <!%_CURSOR!><!A1> <!%_BODYEND></body></html>");

              //add components
              getChildren().add(browser);
          }
      }
      ---------- END SOURCE ----------

      SUPPORT :
      YES

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: