Differences between "standard" css

David Grieve david.grieve at oracle.com
Fri Jul 6 05:59:30 PDT 2012

There are many CSS feature requests in JIRA that address these. Since CSS bugs end up in my lap, you can run the query "assignee = dgrieve AND (status = Open OR status = New)"  to get an idea. 

Other comments in-line
On Jul 6, 2012, at 5:52 AM, Pedro Duque Vieira wrote:

> Here are some of the ways that javafx differs from standard css (not a
> comprehensive list, just a list of the ones that come to my mind):
> 1-     Use of -fx- prefix everywhere.
> This was made so that javafx css would not interfere with standard css
> written on the same file. However I don't see this scenario coming up that
> often, and you can use different identifiers or css files if you happen to
> use the two models on the same app.

The need for the -fx- prefix is more for taking a JavaFX CSS file and using it in a browser.  We should support border-color, for example, but  border-color only supports one layer of color whereas -fx-border-color supports many layers of paint. 

> 2-    Effects
> Drop shadow and inner shadow syntax differs from HTML syntax

Good point, and I don't think there is an issue in JIRA for this one. Would you mind creating one?

> 3-  Lack of support for "margin"

JavaFX doesn't implement the box model, per se. The class Region is where backgrounds and borders are encapsulated and "margin" can be accomplished through a combination of -fx-padding and -fx-background-insets. But in practice, you'd do this with layout. 

I'm not saying that JavaFX doesn't need margin, nor am I saying it does. 

> 4- The ":first-child",  ":first-line", ":first-letter" is not supported

There is a feature request for this as well. 

> 5-The ":active" and ":focus" dynamic pseudo-classes are not supported,
> Their name in javafx is  ":pressed" and ":focused"

This is another place where we need to reconcile JavaFX CSS with W3C standard CSS. The pseudo-class names in JavaFX match the JavaFX property names and they should probably be prefixed with -fx-.
> 6- ":link" is not supported
> 7- JavaFX CSS does not support comma-separated series of font family names
> in the -fx-font-family property

This has been a bug for a long, long time. 

> 8- Not sure but I think the ordering on some css properties is different
> And some more debatable ways that could make no sense to support:
> 9- The optional line height parameter when specifying fonts is not supported
> 10- No support for p, div, h1, h2, a...
> Thanks, best regards,
> -- 
> Pedro Duque Vieira

David Grieve | Principal Member of Technical Staff
Mobile: +16033121013 
Oracle Java Client UI and Tools
Durham, NH 03824 
 Oracle is committed to developing practices and products that help protect the environment

More information about the openjfx-dev mailing list