On Fri, 12 Jan 2024 23:44:14 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> 1. With variable height cells: if I click below the scrollbar thumb, followed 
> by a click above the thumb, I expect the view to go back to the same position 
> exactly, but it does not (see the screenshots).  I think I've mentioned this 
> problem before in some other PR.

This is one of the major difficulties with the VirtualFlow. The word "expect" 
is very context-dependent. Different scenario's have different expectations. As 
long as there is nothing specified in the JavaDoc, I don't think one can expect 
anything.
In this particular case, for example, I can think of a number of reasons why 
you will not go back to the exact same position.
* a cell has been added (outside the viewport).
* the contents of a cell (outside the viewport) have changed, leading to 
different sizes
* the estimates for cell dimensions have been updated

The location of the scrollbar thumb does not depend on previous actions, but on 
the current estimated position in the total sheet, which may vary for a number 
of reasons. We have the implicit restriction that even though the estimated 
position may change intermediately, we will not reposition the scrollbar thumb 
unless there is an explicit user action (scrolling or jumping etc).

For some time, we have been going back and forth to patch VirtualFlow in order 
to match particular expectations. By making a change, it is often very likely 
that the expectations in some scenario are violated -- although no contract is 
violated, hence no bug is introduced.
With the changes in VirtualFlow over the past years, we implicitly specify the 
expectations by adding regression tests.
In the end, it would be good to somehow have an exhaustive specification 
document.

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

PR Comment: https://git.openjdk.org/jfx/pull/1326#issuecomment-1890386099

Reply via email to