Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8265669: AccumCell should not be visible #474

Closed
wants to merge 1 commit into from

Conversation

@johanvos
Copy link
Collaborator

@johanvos johanvos commented Apr 21, 2021

Hide accumCell when the cell is released.
Fix for JDK-8265669


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/474/head:pull/474
$ git checkout pull/474

Update a local copy of the PR:
$ git checkout pull/474
$ git pull https://git.openjdk.java.net/jfx pull/474/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 474

View PR using the GUI difftool:
$ git pr show -t 474

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/474.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 21, 2021

👋 Welcome back jvos! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Apr 21, 2021
@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Apr 21, 2021

/reviewers 2

@openjdk
Copy link

@openjdk openjdk bot commented Apr 21, 2021

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Apr 21, 2021

It looks simple and safe enough, so 1 reviewer should be fine. I'll let Ajit review it.

/reviewers 1

@openjdk
Copy link

@openjdk openjdk bot commented Apr 21, 2021

@kevinrushforth
The number of required reviews for this PR is now set to 1.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 21, 2021

Webrevs

@kevinrushforth kevinrushforth removed their request for review Apr 22, 2021
@aghaisas
Copy link
Collaborator

@aghaisas aghaisas commented Apr 23, 2021

The change as such is fine, but, I have two questions at a higher level -

(from JBS description) - "This will lead to a call to Cell.updateItem(). That was already happening before, but it is happening more often now in case the gradual caching goes faster than the scrolling. "

Question - 1) How did you find out it is happening more often? Do you have any test that you feel is worth adding?

(from JBS bug description) - "In order to allow this logic to still be possible, I suggest the accumCell should always made be invisble after it has done its work. That way, the updateItem can clearly decide what to do, based on not only the index, but also the visibility of the considered item. "

Question - 2) Does this mean any followup work is needed to tweak updateItem after this change ?

@johanvos
Copy link
Collaborator Author

@johanvos johanvos commented Apr 23, 2021

The change as such is fine, but, I have two questions at a higher level -

Thanks. The answers are higher level as well, as they are more about the expectations of updateItem()

(from JBS description) - "This will lead to a call to Cell.updateItem(). That was already happening before, but it is happening more often now in case the gradual caching goes faster than the scrolling. "

Question - 1) How did you find out it is happening more often? Do you have any test that you feel is worth adding?

The fix for JDK-8089589 gradually adds more information about the size of the items that are not yet displayed, in order to be able to gradually estimate the correct position of the scrollbar thumb. In order to do so, the entries need to be calculated, which includes a call to Cell.updateItem(). The current implementation will add 2 new cells per re-layout into the calculations.
I don't think a test would add value here, as there is no binary right or wrong.
The conceptual issue is more about the contract of Cell.updateItem(). That method is called when the contents of a cell change, but this does not imply that the considered cell is visible. Indeed, the VirtualFlow has the concept of an accumCell that is not visible in the control, but it is used for a number of calculations.

(from JBS bug description) - "In order to allow this logic to still be possible, I suggest the accumCell should always made be invisble after it has done its work. That way, the updateItem can clearly decide what to do, based on not only the index, but also the visibility of the considered item. "

Question - 2) Does this mean any followup work is needed to tweak updateItem after this change ?

No, the JavaFX implementations don't need to change. However, developers can now check in their updateItem method whether the considered cell is visible or invisible (in which case it is most likely the accumCell). Nothing in the Cell.updateItem specifies that the considered cell is visible, and the implementations should do what is needed to layout the cell. However, there implementations in third-party code that depend on the cell index of the considered cell to do some (non UI-related) logic, and if that logic falsely assume that the considered cell is visible, the results are not what the developer expects. Since the contract doesn't say the cell is visible, this is not a spec error, but if the cell.isVisible() returns true (as could have been the case before this fix), developers have no way to find out if the cell is shown or not (even if the accumCell was visible, it was still not shown as the code in VirtualFlow prevents this)

@aghaisas
Copy link
Collaborator

@aghaisas aghaisas commented Apr 26, 2021

Thanks for the detailed answers.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 26, 2021

@johanvos This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8265669: AccumCell should not be visible

Reviewed-by: aghaisas

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 14 new commits pushed to the master branch:

  • ed080c8: 8262276: Debug build of WebKit fails
  • db30e71: 8265513: Openjfx graphics build broken (Eclipse)
  • b50ce94: 8264952: [TestBug] Controls unit tests - ControlTest and SpinnerTest fail for non US Locale
  • 27e57d3: 8265469: Allow to build media and webkit for Linux-AArch64
  • dfda00d: 8265514: Openjfx controls running tests broken (Eclipse)
  • 1b407cc: 8239880: CSS tests should cleanup any global state they modify
  • fab638a: 8265425: Hard failure when building OpenJFX for Linux AArch64
  • dffdc6f: 8265758: [TestBug] Remove ignored unit test from CustomMenuItemTest
  • 4a9c892: 8264064: Cross compile JavaFX graphics and controls modules for Windows AArch64 (ARM64)
  • 86b854d: 8234077: Evaluate ignored unit tests in RenderRootTest
  • ... and 4 more: https://git.openjdk.java.net/jfx/compare/e02cee966780f5e3056db80851ef59929ab76ab0...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Apr 26, 2021
@johanvos
Copy link
Collaborator Author

@johanvos johanvos commented Apr 26, 2021

/integrate

@openjdk openjdk bot closed this Apr 26, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 26, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 26, 2021

@johanvos Since your change was applied there have been 14 commits pushed to the master branch:

  • ed080c8: 8262276: Debug build of WebKit fails
  • db30e71: 8265513: Openjfx graphics build broken (Eclipse)
  • b50ce94: 8264952: [TestBug] Controls unit tests - ControlTest and SpinnerTest fail for non US Locale
  • 27e57d3: 8265469: Allow to build media and webkit for Linux-AArch64
  • dfda00d: 8265514: Openjfx controls running tests broken (Eclipse)
  • 1b407cc: 8239880: CSS tests should cleanup any global state they modify
  • fab638a: 8265425: Hard failure when building OpenJFX for Linux AArch64
  • dffdc6f: 8265758: [TestBug] Remove ignored unit test from CustomMenuItemTest
  • 4a9c892: 8264064: Cross compile JavaFX graphics and controls modules for Windows AArch64 (ARM64)
  • 86b854d: 8234077: Evaluate ignored unit tests in RenderRootTest
  • ... and 4 more: https://git.openjdk.java.net/jfx/compare/e02cee966780f5e3056db80851ef59929ab76ab0...master

Your commit was automatically rebased without conflicts.

Pushed as commit 6b63bf5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants