Opacity elements broken for svg

Kevin Rushforth kevin.rushforth at oracle.com
Mon Sep 19 13:01:46 UTC 2022


This belongs on the openjfx-dev list, so I'm rerouting it (I Bcc'ed 
openjfx-discuss)

I haven't heard other reports of https://bugreport.java.com being 
broken, but I can file the bug for you.

-- Kevin


On 9/19/2022 5:47 AM, Thorsten wrote:
> Hello
>
> This is a bug report that should go through 
> https://bugreport.java.com/ , however the bug report site only gives 
> me 'Access Denied You don't have permission to access 
> "http://splash.oracle.com/bugreport/submit_start.do?" on this server.' 
> whenever I hit submit. Is it broken for everyone or did I get 
> blacklisted?
>
> So since openjx 18 using opacity="<value>" will just behave like 
> opacity was set to 1. -> In the Example: two black circles instead of 
> one black and one teal circle. Version 17.0.2 works fine
>
> Example svg was taken from 
> https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/opacity
>
> Best regards,
>
> Thorsten Goetzke
>
>
>
> package com.example.demo;
>
> import javafx.application.Application;
> import javafx.scene.Scene;
> import javafx.scene.web.WebView;
> import javafx.stage.Stage;
>
>
> public class HelloApplication extends Application {
>     @Override
>     public void start(Stage stage) {
>         final WebView webView = new WebView();
>         final String svg = "<svg viewBox=\"0 0 200 100\" 
> xmlns=\"http://www.w3.org/2000/svg\">\n" + "  <defs>\n" + "    
> <linearGradient id=\"gradient\" x1=\"0%\" y1=\"0%\" x2=\"0\" 
> y2=\"100%\">\n" + "      <stop offset=\"0%\" 
> style=\"stop-color:skyblue;\" />\n" + "      <stop offset=\"100%\" 
> style=\"stop-color:seagreen;\" />\n" + " </linearGradient>\n" + "  
> </defs>\n" + "  <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" 
> fill=\"url(#gradient)\" />\n" + "  <circle cx=\"50\" cy=\"50\" 
> r=\"40\" fill=\"black\" />\n" + "  <circle id=\"circle\" cx=\"150\" 
> cy=\"50\" r=\"40\" fill=\"black\" opacity=\"0.3\" />\n" + "</svg>\n";
>         webView.getEngine().loadContent(svg);
>         stage.setScene(new Scene(webView));
>         stage.show();
>     }
>
>
>     public static void main(String[] args) {
>         launch();
>     }
> }
>



More information about the openjfx-discuss mailing list