RFR: 8370498: Improve how Node detects whether a layout property change requires a new layout pass [v4]
Marius Hanl
mhanl at openjdk.org
Thu Oct 30 15:04:44 UTC 2025
On Thu, 30 Oct 2025 13:35:06 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:
> With this PR 1 + 2 will work, and probably can get 4 fixed as well.
I would prefer this option.
In my opinion, it is worth pursuing this option because it improves consistency, performance and simply makes sense to me.
The previous behavior felt like an oversight that just worked accidently.
I wonder if we need to combine what Johan said: Having warnings (if easily possible) for things you should rather not do.
For example, reading what you wrote above:
> Modifying CSS during layout (which changes anything size or position related) is a guaranteed jump of your UI as a next pass is required
> For example, you also should not be modifying the scene graph during layout, because if you say add a new child (like a list cell or something) that cell will be rendered without styles
This is good information I even did not know in full detail (although it looks like I made this correct for my own components, because I did what JavaFX is doing).
Having warnings or information for that would be nice. Since we now can detect correctly when we layout children, we may can detect is something triggered another CSS pass although it should better not do that now, and what to do instead. This way, even is something now breaks, we could get information why this unusual combination does not work as expected.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1945#issuecomment-3468472862
More information about the openjfx-dev
mailing list