JavaFX webview does not support filters?

721 views Asked by At

Looking at WebView inside JavaFX 8 (JRE 1.8.0_25 to be precise), it would appear that -webkit-filter is completely broken.

Any attempt to apply a -webkit-filter CSS rule to any HTML component causes the underlying data to disappear completely.

You can see a demonstration by loading: http://html5-demos.appspot.com/static/css/filters/index.html into the WebView. If you set any of the filters on the page, the image just disappears.

Is this a known bug? Is there a known workaround?

Update: After retesting with JRE 8u77, this now appears to be improved but not fixed entirely. Using -webkit-filter anywhere in a page creates rendering errors. Load the following HTML into a JavaFX WebView to see:

<html>
<body style="background-color: #888">
<div id='xx' style="-webkit-transform-origin: 0 0; -webkit-transform: scale(5)">
This is some text
<button onclick="document.getElementById('xx').style.webkitFilter = 'invert(100%)'">Click me</button>
</div>
</body>
</html>
1

There are 1 answers

0
jewelsea On BEST ANSWER

From your testing, the answer is no, JavaFX 8 WebView does not support -webkit-filter.

The data shouldn't disappear completely if there is a -webkit property (the property should just be ignored and the image rendered as though the property never existed), so you could file a bug report on that in the JavaFX issue tracker.

I wouldn't term the lack of support for a draft w3c specification or any -webkit css attributes a bug. WebView will never officially support -webkit properties, it will support a lot of non-draft w3c html/css specifications. If you are interested in discussing implementation of such features in more detail or would like to participate in enabling them in WebView, post to the openjfx-dev mailing list.