6

I know that the JavaFX WebEngine component has some features not included that are available in most modern browsers (WebGL, UserMedia, GeoLoacation). But I just found out that css3 features like background-gradient don't seem to be supported as well.

Does somebody know of a feature list of the JavaFX WebEngine concerning CSS3? The official documentation from Oracle just says: "The embedded browser component is based on WebKit, an open source web browser engine. It supports Cascading Style Sheets (CSS), JavaScript, Document Object Model (DOM), and HTML5."

[Edit]: gradient is supported. Seems I had a mistake in my css. But nevertheless I'd be thankful about some documentation of supported features.

P.J.Meisch
  • 18,013
  • 6
  • 50
  • 66
  • I don't think there is official documentation pertaining specifically to CSS3, but there is mention of CSS3 in the official JavaFX CSS Reference Guide. Even this is not geared towards the WebEngine. See: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html – axiopisty Dec 29 '15 at 18:11

1 Answers1

3

I don't think there is a list of the features it supports or not. As stated in your question, WebEngine is based in WebKit, but even if you know the exact version it is based on, you will have to check if it was tweaked/changed.

I think the best option here is to run a bunch of tests (like the ones provided by css3test.com) in the WebEngine and use that as a guideline

import java.io.IOException;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class CSS3Test extends Application {
    @Override
    public void start(Stage stage) throws Exception {
        StackPane pane = new StackPane();
        WebView view = new WebView();

        WebEngine engine = view.getEngine();
        engine.load("http://css3test.com/");
        pane.getChildren().add(view);

        Scene scene = new Scene(pane, 960, 600);
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) throws IOException {
        Application.launch(args);
    }
}

enter image description here

It's far from perfect (even if it supports feature "X", this does not mean that feature is correctly implemented, or even works at all), but should help you get an overview of the supported features.

Salem
  • 12,808
  • 4
  • 34
  • 54