New CSS parser for JavaFX

Michael Strauß michaelstrau2 at gmail.com
Mon Aug 26 20:42:40 UTC 2024


> can we create stylesheets programmatically without parsing (i.e. construct the token tree directly)?

Maybe, but `Stylesheet` and its constituent classes really seem like
exposed implementation details of JavaFX. I would rather deprecate
their use and remove them from the public API eventually.


> would it be possible to add a diagnostic (at the moment of applyCSS()) to show the actual rule(s) being used?

Sure, the grammar of a declaration is defined by its StyleConverter,
which can emit diagnostics if so required. This is not so different
from how it is done currently.


> are we going to track the evolution of https://www.w3.org/TR/css-syntax-3/ "spec"?

As far as it pertains to features implemented by JavaFX, yes.


> are we going to clarify the w3 "spec" (what is the value of "EOF code point"?)?

I'm not sure what you mean by that. The specification is quite clear
and unambiguous, so I don't know what we would need to clarify. If you
refer specifically to the EOF code point: there is no value of any
kind associated with that in the syntax API, as it is conceptual only
and not a preserved token.


> are there incompatibilities between web-style CSS and FX-style CSS?

Yes, the grammar and semantics of JavaFX CSS is defined by its
particular implementation, which is different from a HTML document
model. However, there are several things we can do to make them less
dissimilar, for example by supporting shorthand notations in the
future, or supporting notations that are defined in other W3C modules
(color functions come to mind).


> what is the testing strategy?

I don't have anything in mind that goes beyond the usual testing that
we do for all enhancements.


More information about the openjfx-dev mailing list