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

Opacity in WebView not working anymore

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • jfx20
    • jfx18.0.1, jfx19
    • javafx
    • web
    • b15

    Backports

      Description

        This HTML code should produce a grey rectangle and is now black:

        <html>
        <body style="background-color: #FFFFFF; margin: 0px;">
        <div style="color: #FFFFFF; background-color: #000000; opacity: 0.5; width:100px; height:100px;"> </div>
        </body>
        </html>

        Last worked in 18.
        Failing since 18.0.1 / 19
        Might be related to the SVG problem from JDK-8294011

            @Test public void testOpacityRendering() {
                loadContent("<html>\n" +
                        "<body style=\"background-color: #FFFFFF; margin: 0px;\">\n" +
                        "<div style=\"color: #FFFFFF; background-color: #000000; opacity: 0.5; width:100px; height:100px;\"> </div>\n" +
                        "</body>\n" +
                        "</html>");
                submit(() -> {
                    final WebPage webPage = WebEngineShim.getPage(getEngine());
                    assertNotNull(webPage);
                    final BufferedImage img = WebPageShim.paint(webPage, 0, 0, 800, 600);
                    assertNotNull(img);

                    final Color pixelAt50x50 = new Color(img.getRGB(50, 50), true);
                    assertTrue("Color should be gray:" + pixelAt50x50, isColorsSimilar(Color.GRAY, pixelAt50x50, 1));
                });
            }

        Attachments

          Issue Links

            Activity

              People

                rmarchenko Roman Marchenko
                oschmidtmer Oliver Schmidtmer
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: