RFR: 8370498: Improve how Node detects whether a layout property change requires a new layout pass [v5]

Marius Hanl mhanl at openjdk.org
Thu Feb 12 18:17:28 UTC 2026


On Thu, 15 Jan 2026 16:47:28 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> This new check is much more accurate to detect whether a parent is currently laying out its children. The previous code almost never worked, resulting in additional unnecessary layouts.
>
> John Hendrikx has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
> 
>  - Merge branch 'master' into feature/in-layoutchildren-detection-for-node
>  - Rename test
>  - Add regression test
>  - Fix ToolBarSkinTest
>    
>    Reusing a toolbar as part of several scenes, in combination with the StubToolkit that doesn't handle pulses makes this test fail with the relayout detection fix.
>  - Change how Node detects whether a relayout is required
>    
>    This new check is much more accurate to detect whether a parent is currently laying out its children. The previous code almost never worked, resulting in additional unnecessary layouts.

Looks good to me. 

Did a bunch of tests with it on several application. Everything fine.
Also runs within a JPackaged Application for over 2 months now without problems.

Minor nitpick to improve the `assertEquals` message. Since we have some ideas to improve this at one point, I can imagine this test failing / need to be reworked at one point, so a helpful message would be nice!

Also the minor nitpick that Andy mentioned (try-finally).
Note that the Copyright Header need to be adjusted to 2026.

modules/javafx.graphics/src/test/java/test/javafx/scene/NodeTest.java line 2239:

> 2237:         for (int i = 0; i < subtree.size(); i++) {
> 2238:             Parent p = subtree.get(i);
> 2239:             assertEquals(flags[i], ParentShim.getLayoutFlag(p), "" + p);

Minor: Description can be improved here

-------------

Marked as reviewed by mhanl (Committer).

PR Review: https://git.openjdk.org/jfx/pull/1945#pullrequestreview-3792789712
PR Review Comment: https://git.openjdk.org/jfx/pull/1945#discussion_r2800356661


More information about the openjfx-dev mailing list