Re: New CSS parser for JavaFX

2024-08-26 Thread Michael Strauß
> > I did not mean a specific class, but a stylesheet in general. I just think > that there should be a way to construct a stylesheet in memory that does not > require parsing, and ideally with an option to do a limited type check. > Unless it significantly increases the overall effort, in whi

Re: New CSS parser for JavaFX

2024-08-26 Thread Michael Strauß
I don't think that's practical, as the proposed enhancement will change parsing, representation (Declaration, ParsedValue) and runtime processing (CssStyleHelper). I don't know how we would keep the old implementations around. On Tue, Aug 27, 2024 at 12:01 AM Andy Goryachev wrote: > > I wonder i

Re: New CSS parser for JavaFX

2024-08-26 Thread Michael Strauß
On Mon, Aug 26, 2024 at 11:14 PM John Hendrikx wrote: > > The CSS code, and its API, to put it diplomatically, is IMHO a bit under > cooked. > > I've had quite a few looks at it, and each time I've come to the > conclusion that it is near impossible to do any worthwhile improvements > to it withou

Re: New CSS parser for JavaFX

2024-08-26 Thread Michael Strauß
It's certainly true that CSS is a fragile area, but I would argue that one of the reasons it's fragile is because the implementation is a bit unsound in many places. Cleaning up tech debt could make this progressively more robust in the long run. Note that I'm also not proposing a refactor to make

Re: New CSS parser for JavaFX

2024-08-26 Thread Andy Goryachev
see inline > 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 AP

Re: New CSS parser for JavaFX

2024-08-26 Thread Andy Goryachev
I wonder if this could be done as an incubator module, or hidden behind an experimental system property. -andy From: openjfx-dev on behalf of Kevin Rushforth Date: Monday, August 26, 2024 at 14:40 To: openjfx-dev@openjdk.org Subject: Re: New CSS parser for JavaFX Deprecating the existing

Re: New CSS parser for JavaFX

2024-08-26 Thread Kevin Rushforth
Deprecating the existing API is an interesting idea, but with such a large API surface it will be difficult to show that no application is using it. -- Kevin On 8/26/2024 2:35 PM, John Hendrikx wrote: On 26/08/2024 22:42, Michael Strauß wrote: can we create stylesheets programmatically with

Re: New CSS parser for JavaFX

2024-08-26 Thread John Hendrikx
On 26/08/2024 22:42, Michael Strauß wrote: 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

Re: New CSS parser for JavaFX

2024-08-26 Thread Kevin Rushforth
k.org *Subject: *Re: New CSS parser for JavaFX Lots of things might be good ideas. I'm rather skeptical of the cost / benefit of implementing a new CSS parser. This would be a large effort and run a significant risk of regression, especially since CSS is a fragile area (although parsin

Re: New CSS parser for JavaFX

2024-08-26 Thread John Hendrikx
The CSS code, and its API, to put it diplomatically, is IMHO a bit under cooked. I've had quite a few looks at it, and each time I've come to the conclusion that it is near impossible to do any worthwhile improvements to it without at a minimum getting rid of the ParsedValue abomination.  Thi

Re: New CSS parser for JavaFX

2024-08-26 Thread Michael Strauß
> 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

Re: New CSS parser for JavaFX

2024-08-26 Thread Andy Goryachev
e applicable, but it certainly does not help. -andy From: openjfx-dev on behalf of Kevin Rushforth Date: Monday, August 26, 2024 at 11:52 To: openjfx-dev@openjdk.org Subject: Re: New CSS parser for JavaFX Lots of things might be good ideas. I'm rather skeptical of the cost / benefit

Re: New CSS parser for JavaFX

2024-08-26 Thread Kevin Rushforth
Lots of things might be good ideas. I'm rather skeptical of the cost / benefit of implementing a new CSS parser. This would be a large effort and run a significant risk of regression, especially since CSS is a fragile area (although parsing less so than the runtime CSS processing). -- Kevin

Re: New CSS parser for JavaFX

2024-08-26 Thread Andy Goryachev
Michael: This might be a good idea. A few questions: * can we create stylesheets programmatically without parsing (i.e. construct the token tree directly)? * would it be possible to add a diagnostic (at the moment of applyCSS()) to show the actual rule(s) being used? * are we goin