RFR: 8277785: ListView scrollTo jumps to wrong location when CellHeight is changed [v4]

Florian Kirmaier fkirmaier at openjdk.java.net
Mon May 16 11:08:04 UTC 2022


On Sun, 8 May 2022 18:56:45 GMT, Johan Vos <jvos at openjdk.org> wrote:

>> @johanvos 
>> As requested, we've made a unit test, which tests this bug.
>> It's based on your test and our original test class. It can be added to the ListViewTest.
>> You can find it, in the JDK ticket.
>> 
>> Btw, adding the cells incrementally seems to make a difference - which is why the new test class tests both cases.
>> 
>> It accepts various inputs of cell sizes - and should work with any inputs.
>> It should catch all the cases from the original test class.
>> Because it works with all possible inputs - one could even make a random test-cases generator to make sure it works in every case.
>> 
>> It basically only works well, when the sizes are only 20s - in most other cases it fails.
>
> The later reported issues were due to the fact that the estimatedSize got updated during the layoutChildren call. That makes things much more complicated and leads to discrepancies. I disabled the updates to the estimated size during the layoutChildren call, so that all operations that are happening in that call are using a consistent value of the estimated size. We now pass all the tests added by @FlorianKirmaier on the JBS issue . Those tests are great regression tests.

Hi @johanvos,

I've updated the TestClass once more. You can find it on the ticket.

There are 2 cases that seem to not work properly yet.

1.) If the elements are very big, the tests seem to fail - but it only happens if the scene is layouted again.

2.) On Click, the element gets selected and the VirtualFlow "jumps around".
I've adapted the tests to simulate the click with the selectionModel.
I've also added another assert, to check whether our cell is visible - which seems to be not always the case.

Both cases were also reproducible with the original test application.

Btw, can I somehow become an official reviewer for this PR?

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

PR: https://git.openjdk.java.net/jfx/pull/712


More information about the openjfx-dev mailing list