I think this is a good idea.
I have checked the CSS code some time myself and also removed all the special property checks just to see what will happen and why it is needed. With the gathered knowledge, I can confirm what you wrote down in your proposal and that you have the correct idea to solve this problem.
Right now, the CSSParser tries to guess what the value is used for. If there is something with "px", well it must be some kind of unit hopefully. If there is "ms", it must be time. That works most of the time, but not always. It therefore also works most of the time for your own properties, but again, may not always.
So the proposed solution of a parsing and a interpretation phase sound correct and should solve the problem. It also simplify things.
So this is something I will also give my +1 to it. Regarding tests, when you work on that proposal and add tests for the new CSSParser, we could check if it is easy to "cherrypick" them to the existing CSSParser so that we can verify and guarantee that everything still works, maybe also that some things do not work and fail as expected.
-- Marius Am 26.08.24, 05:47 schrieb "Michael Strauß" <michaelstr...@gmail.com>:
I've written up a proposal to implement a new CSS parser for JavaFX:
https://gist.github.com/mstr2/f416996caf48e11193f0b6a5883a3926
The goal is not add new features at this point, but to resolve some
long-standing issues with the existing CSS parsing (though if you read
carefully, you might spot a new feature).
I'm interested in your opinion whether this is a good idea to move forward.
|