Hallo zusammen,
ich bin über ein Problem gestolpert, dass der JavaFX WebView ab einer bestimmten Version keine CSS Animationen bei einem SVG mehr anzeigt. Ich habe ein SVG auf einem Webserver, welches Maschinenzustände anzeigt. Diese werden durch CSS Animationen verändert. Dieses SVG wird dann in einer Java Applikation mithilfe eines WebViews angezeigt.
Nach dem Update von OpenJDK 1.8.0.265 nach OpenJDK 1.8.0.282 hörte der WebView auf einmal auf, jegliche Animationen darzustellen, während der Browser (Google Chrome und Firefox) die Animationen noch darstellen konnte. Ich konnte in den Release Notes von Java 8 nichts finden, dass irgendwas am WebView geändert worden ist. Ist jemand über das gleiche Problem gestolpert oder weiß, wo man solche Bugs melden muss? Ein Update auf Java >8 kommt leider nicht in Frage.
Betriebssystem: Windows10
JDK: ojdkbuild (Github)
Code zum Reproduzieren:
ich bin über ein Problem gestolpert, dass der JavaFX WebView ab einer bestimmten Version keine CSS Animationen bei einem SVG mehr anzeigt. Ich habe ein SVG auf einem Webserver, welches Maschinenzustände anzeigt. Diese werden durch CSS Animationen verändert. Dieses SVG wird dann in einer Java Applikation mithilfe eines WebViews angezeigt.
Nach dem Update von OpenJDK 1.8.0.265 nach OpenJDK 1.8.0.282 hörte der WebView auf einmal auf, jegliche Animationen darzustellen, während der Browser (Google Chrome und Firefox) die Animationen noch darstellen konnte. Ich konnte in den Release Notes von Java 8 nichts finden, dass irgendwas am WebView geändert worden ist. Ist jemand über das gleiche Problem gestolpert oder weiß, wo man solche Bugs melden muss? Ein Update auf Java >8 kommt leider nicht in Frage.
Betriebssystem: Windows10
JDK: ojdkbuild (Github)
Code zum Reproduzieren:
[CODE lang="svg" title="SVG"]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448"
height="524.40942"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="drawing.svg">
<defs
id="defs4" />
<style
type="text/css"
id="style2996"><![CDATA[
.rectangleColorFade {
animation-name: color;
animation-duration: 4s;
animation-iteration-count: infinite;
}
@keyframes color {
0% {fill: red;}
25% {fill: yellow;}
50% {fill: blue;}
100 {fill: green;}
}
]]></style>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape
ageopacity="0.0"
inkscape
ageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="318.70276"
inkscape:cy="324.20795"
inkscape:document-units="px"
inkscape:current-layer="svg2"
showgrid="false"
inkscape:window-width="1856"
inkscape:window-height="1057"
inkscape:window-x="56"
inkscape:window-y="797"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<rect
class="rectangleColorFade"
id="rectangle"
width="238.396"
height="172.73608"
x="263.64981"
y="131.96516" />
</svg>
[/CODE]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448"
height="524.40942"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="drawing.svg">
<defs
id="defs4" />
<style
type="text/css"
id="style2996"><![CDATA[
.rectangleColorFade {
animation-name: color;
animation-duration: 4s;
animation-iteration-count: infinite;
}
@keyframes color {
0% {fill: red;}
25% {fill: yellow;}
50% {fill: blue;}
100 {fill: green;}
}
]]></style>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape
inkscape
inkscape:zoom="1.979899"
inkscape:cx="318.70276"
inkscape:cy="324.20795"
inkscape:document-units="px"
inkscape:current-layer="svg2"
showgrid="false"
inkscape:window-width="1856"
inkscape:window-height="1057"
inkscape:window-x="56"
inkscape:window-y="797"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<rect
class="rectangleColorFade"
id="rectangle"
width="238.396"
height="172.73608"
x="263.64981"
y="131.96516" />
</svg>
[/CODE]
[CODE lang="java" title="Controller"]public class Controller implements Initializable
{
@FXML
WebView webView;
@Override
public void initialize(URL location, ResourceBundle resources)
{
loadWebsite("http://localhost/drawing.svg");
}
public void loadWebsite(String website)
{
WebEngine webEngine;
webEngine = webView.getEngine();
webEngine.load(website);
}
}[/CODE]
{
@FXML
WebView webView;
@Override
public void initialize(URL location, ResourceBundle resources)
{
loadWebsite("http://localhost/drawing.svg");
}
public void loadWebsite(String website)
{
WebEngine webEngine;
webEngine = webView.getEngine();
webEngine.load(website);
}
}[/CODE]