<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Right. Apart from a unit test for this specific issue, I would like us at least to
<b>think</b> about enumerating the typical scenarios and scenarios where the outcome might be different.</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-andy</div>
<div dir="ltr" style="font-family: "Iosevka Fixed SS16", Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing">
<meta name="Generator" content="Microsoft Exchange Server">
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Kevin Rushforth <kcr@openjdk.org><br>
<b>Date: </b>Friday, October 24, 2025 at 07:40<br>
<b>To: </b>openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br>
<b>Subject: </b>Re: RFR: 8370498: Improve how Node detects whether a layout property change requires a new layout pass [v2]<br>
<br>
</div>
<div class="PlainText" style="font-size: 11pt;">On Fri, 24 Oct 2025 05:33:45 GMT, John Hendrikx <jhendrikx@openjdk.org> wrote:<br>
<br>
>> John Hendrikx has updated the pull request incrementally with one additional commit since the last revision:<br>
>><br>
>> Fix ToolBarSkinTest<br>
>> <br>
>> 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.<br>
><br>
>> _Mailing list message from [Andy Goryachev](<a href="mailto:andy.goryachev@oracle.com" data-outlook-id="dcf4a0ac-048c-4bd2-8d71-89890142cec8">mailto:andy.goryachev@oracle.com</a>) on [openjfx-dev](mailto:openjfx-dev@mail.openjdk.org):_<br>
>><br>
>> > We will need a unit test for this.<br>
>><br>
>> Perhaps we could even get it a bit further than that. What would you say could be a sufficiently comprehensive set of tests/scenarios to reduce the probability of regression?<br>
>><br>
>> Let's say, we limit the depth of the hierarchy to 3 (node-parent-parent), then the combinatorial complexity should still be manageable.<br>
>><br>
>> What do you think?<br>
><br>
> As much as I'd like to help out more, after analyzing this problem already for almost two full days, I don't have time to write a comprehensive test suite for one of the more complex systems in JavaFX. I can of course extend existing tests to get behavioral
coverage on this new fix.<br>
><br>
> So, I think we then should choose what we want. We can revert <a href="https://bugs.openjdk.org/browse/JDK-8360940" data-outlook-id="90f6a5fd-3456-4173-9ef3-04449df68c4d">
https://bugs.openjdk.org/browse/JDK-8360940</a> and go back to a situation where the layout system can easily get into a bad state while using documented API's, or we can take a critical look at this new fix, which is fixing a long standing problem that was
hidden by the bug that was fixed, and could be a major performance improvement for complex UI's.<br>
><br>
> I think manual testing with some large UI's and/or Monkey Tester should be more than sufficient to discover if this is likely to cause regressions, and I've already been doing so before I submitted this fix (I tend to just apply these fixes to my own code
directly, to see how they work out). <br>
><br>
> If we're still unsure, a system property can turn this on/off easily, at the cost of getting some redundant layout passes in the "off" mode (as it was before).<br>
><br>
> I already knew that the detection that `Node` was doing for triggering a 2nd layout pass was bogus, because `isCurrentLayoutChild` is simply not updated at the correct moments for this to work. It works if you ask if a Node's **parent** is the current layout
child of the **grand parent**, but it does not work for one level deeper: asking if a node is the current layout child of its parent.<br>
><br>
> That the logic looked correct at first glance may have have convinced the original authors that it does work, but it doesn't. More importantly, it can't be fixed as a fix would require **each** modification of layout X/Y to wrap this change by setting the
current layout child first -- that would require updating all layout containers, all 3rd party layout containers, and all 3rd party code that calls `relocate` or sets...<br>
<br>
@hjohn Thank you for providing the additional analysis. This will help those of us who will review this proposed fix evaluate it to see if we can poke any holes in it.<br>
<br>
As you say, we have two choices before us: fix this bug or revert the fix for [JDK-8360940](https://bugs.openjdk.org/browse/JDK-8360940). If we can convince ourselves that this is the right fix, taking this fix would be preferable to re-introducing JDK-8360940.<br>
<br>
As for testing, I think manual testing using various apps (e.g., Ensemble, MonkeyTester, SceneBuilder) is needed. And while we also need a new test for _this_ fix -- that is, a test that fails before and passes after the fix -- I would agree that adding a whole
battery of functional tests for layout is out of scope and better done as a follow-on.<br>
<br>
Finally, as you point out, we could provide a system property to go back to the way we did it before. If we do that (which I am not advocating at this point in the review), we might consider having that flag also revert the behavior of [JDK-8360940](https://bugs.openjdk.org/browse/JDK-8360940).<br>
<br>
-------------<br>
<br>
PR Comment: <a href="https://git.openjdk.org/jfx/pull/1945#issuecomment-3443507993" data-outlook-id="0923f498-a5ed-4e90-a1f1-b809019c11a2">
https://git.openjdk.org/jfx/pull/1945#issuecomment-3443507993</a><br>
</div>
</div>
</body>
</html>