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

Andy Goryachev angorya at openjdk.org
Thu Jan 15 18:56:47 UTC 2026


On Thu, 15 Jan 2026 18:32:39 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

> for example with multiple layout phases or iteration.

That's exactly right.

To illustrate, I can point to `VFlow:1545` and `VFlow:1559` where a change in either scroll bar visibility triggers `layoutCells()`.  It is the responsibility of the developer of such a component to ensure that the layout converges, i.e. that the logic does not cause infinite recursion.  In the `VFlow` case, it does not - once the vertical scrollbar is determined to have shown up, it cannot disappear; same goes for  the horizontal scrollbar afterwards.

Speaking of the layout system snippet, I might suggest limiting the fast loop to a few iterations only. to guard against locking up:


if(!layoutClean) {
  int fastSteps = 2; // or 3, no more
  for(int i=0; i<fastSteps; i++) {
    doCssPass();
    doLayoutPass();
    if(layoutClean) {
      break;
    }
  }
}

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

PR Comment: https://git.openjdk.org/jfx/pull/1945#issuecomment-3756374441


More information about the openjfx-dev mailing list